[opencms-dev] need some help on customizing the <cms:link> tag

Claus Priisholm cpr at codedroids.com
Tue Sep 9 15:38:19 CEST 2008


What I ran into once I was trying to capture output from the include-tag 
was that if it is cached, the only output your tag get to see is 
something that looks like 32 bit ident... So to catch the output of 
those tags that supports the flex cache you must set "cacheable" to 
false (on the include tag).

Olli Aro wrote:
> Ok, added some debugging info to my parser class and it looks that that one
> is getting called ok with the following tag:
> 
> <cms:parse parserClass="myClassName" param="config">
> 		<cms:include element="body" editable="true" />
> </cms:parse>
> 
> So, it must be that I have something wrong with my parser implementation.
> Maybe I will create a copy of org.opencms.util.CmsHtmlParser and take it
> from there... But still if anyone do have custom parser class for me to show
> that would be very useful :)
> 
> Regards,
> 
> Olli
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Olli Aro
> Sent: 09 September 2008 12:41
> To: 'The OpenCms mailing list'
> Subject: Re: [opencms-dev] need some help on customizing the <cms:link> tag
> 
> Hi Michael,
> 
> Do you have example usage for <cms:parse> tag? How to use it in template and
> what is the best way to implement your own parser? Also, if you would have a
> sample custom parser class that would be very useful.
> 
> I tried to use it with extending org.opencms.util.CmsHtmlParser, returning
> this as my own implementation of
> org.opencms.jsp.parse.A_CmsConfiguredHtmlParser and then doing:
> 
> <cms:parse parserClass="myClassName" param="config">
> 		<cms:include element="body" editable="true" />
> </cms:parse>
> 
> but that did not render anything for the content.
> 
> Regards,
> 
> Olli
> 
> -----Original Message-----
> From: opencms-dev-bounces at opencms.org
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Michael Emmerich
> Sent: 04 September 2008 16:26
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] need some help on customizing the <cms:link> tag
> 
> Kunkun,
> 
>> Hi Kunkun,
>>  
>> for the first part of your question you can possibly use the 
>> <cms:decorate>-Tag. For further details have a look at the 
>> OpenCms-Documentation Modules.
> 
> the <cms:decorate> tag only modified text nodes, this would not help.
> 
> Use the <cms:parse> tag and write your own parser that is triggered by 
> link tags. Modifiy the link tags with the id, e.g. the hash code of the 
> target and write this into a database.
> Sonthing that holds the id, the target and the number of hits.
> In addition add some code to your link that starts a ajax request when 
> the link is klicked. The target of this ajax reqeust must receive the id 
> and increase the number of hits for this id.
> 
> HTH,
> Michael
> 
> 
>> ------------------------------------------------------------------------
>> *Von:* opencms-dev-bounces at opencms.org 
>> [mailto:opencms-dev-bounces at opencms.org] *Im Auftrag von *kk
>> *Gesendet:* Donnerstag, 4. September 2008 16:58
>> *An:* opencms-dev at opencms.org
>> *Betreff:* [opencms-dev] need some help on customizing the <cms:link> tag
>>
>> Dear together,
>>  
>> my name is kunkun. I am a computerscience-student in Germany. I am 
>> working on a project, which extends opencms with some new features.
>>  
>> The problem is:
>>  
>> 1. I have to mark the links, that i create on a site, with something 
>> like an ID.
>> 2. Then i have to log the Link ID, whenever the link is clicked on the 
>> site, when it is made online.
>>  
>> Can u give me some Ideas, how to do that?
>>  
>> My idea is to create a class, which inherits the internal link class of 
>> OpenCms, and change the html-code that is generated during constuction 
>> of the link.
>>  
>> But with which class should I start. There is a class named 
>> CmsJspTagLink, which can be used with <cms:link>.
>> The class CmsLinkManager is also used to substitute the name for links 
>> inside the VFS System. But how do i do
>> it in general purpose not only for internal links?
>>  
>> I am looking for some ideas asap.
>>  
>> Thank u very much.
>>  
>> Kunkun
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
-- 
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms



More information about the opencms-dev mailing list