[opencms-dev] Reuse of HTML snippets

Claus Priisholm cpr at codedroids.com
Wed Apr 28 13:14:02 CEST 2004


Whether it is due to the WYSIWIG editor or not, the fact is that JSP 
tags gets stripped from pages somewhere along the line. If you insert 
this in the source code editor: <%= someValue %>, it is not doing what 
one could hoped for. Note is not just ignored it is actually being 
stripped. So the only other options is to make the pages JSP's which 
actually would be fine if such a file could be edited in the 
WYSIWYG-editor.
The editor marks the included code specifically with a small document 
icon with a pencil in it, so it does have a sense that this tag is 
special - can't do anything with it though. Though it would never be 
WYSIWYG from within the editor, I would think there would be  a way to 
deal with from within the jsptemplate if the inserted tags are 
available at that point in time, but it is not being handled by the 
normal cms.include()-approach.

What you may consider is to have the client to do the work rather than 
the server, i.e. insert specifically named DIVs or the like and have a 
small piece of javascript running in the browser and have that replace 
the DIV with what you really want appear there. But this approach of 
course includes yet another opportunity to realize that there are two 
ways you can interpret a standard - the MS way and the way everyone 
else does :-) and it won't work in old browsers...

On 28/4-2004, at 12.33, Sergio Arias wrote:

> Hi Achim. I didn't want to do it that way, since I have to 'force' page
> editors to include something like <jsp:include .../> in their code, 
> and they
> will be (and should be) just writers. So if they can grasp an image 
> from the
> gallery, why can't they simirlarly grasp a piece of HTML and link it 
> into
> their page?
> I guess that what I'm looking for is a different behaviour of the HTML
> gallery, something that instead of copying the code into the page will
> insert a <jsp:include .../> pointing to the corresponding file.
> Again, have any of you see a module or something to achieve this?
>
>> make just little jsps and include them ...
>> Hope this helps
>
>>> I was wandering if it's possible to have some HTML snippet that I can
>>> include *in a simple manner* through several pages.
>>> I thought HTML galleries will do the job, but for what I've seen it 
>>> just
>>> pastes the code into the content-page and there is no link or 
>>> reference to
>>> the snippet, so if I change it, the pages that I've used it in the 
>>> past
> will
>>> remain with the 'old' copy of the snippet.
>>>
>>> I know I can always use an HTML file and include it using Java, but 
>>> I'm
>>> thinking in something that editors can manage in the administration
> console
>>> (just like HTML galleries). And I don't think different similar 
>>> templates
>>> will do the job in the way I'm thinking of.
>>> As I said, the non-programmatically-advanced editor should be able to
> grasp
>>> the piece of code he want to and reference it from his page such 
>>> that if
>>> that piece of code change, the whole page will change.
>>>
>>> Has OpenCMS something to have this done taht I missed? Could you 
>>> think in
> an
>>> easy way of making it?
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please 
> visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
>
--
Claus Priisholm, CodeDroids ApS
+45 48 22 46 46
cpr (you-know-what) interlet.dk - cpr (you-know-what) codedroids.com
http://www.interlet.dk - http://www.codedroids.com




More information about the opencms-dev mailing list