Re: Best practices - Templates

Cédric REYMANN <[email protected]>
Newsgroups gmane.comp.cms.jahia.template
Organization Actimage
Message-ID <[email protected]>
Thanks for your reply.

That solved my problem, that's exactly what I needed.

Cédric

Marc Cardle a écrit :

Cedric,

The tag ActionMenuTag needs to first check
what actions are supported on
a given content object and then which actions are locked (by another
user).

To lighten the page generation load, you
could use static links instead.

Taking the example of the “Add Container”
function, you
could add the following code to your template:

<% if (!jData.gui().html().drawAddContainerLauncher(theLinks).equals("")) { %>

<tr>

<td width="125" height="24"><a href="javascript:<%=jData.gui().html().drawAddContainerLauncher(theLinks)%>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Add','','<%=theURL%>/images/buttons/add_page_on.gif',1)"><img name="Add" src="<%=theURL%>/images/buttons/add_page_off.gif" width="125" height="24" border="0"></a></td>

</tr>

<% } %>

Or use the Taglib equivalent (note these
examples are not related):

<content:addContainerURL
id="addContainerURL"
display="false"/>

<logic:present
name="addContainerURL">

<br/><a

href="<bean:write
name='addContainerURL'/>"><%=addButton%>&#160;<jahia:resourceBundle

resourceBundle="jahiatemplates.Corporate_portal_templates"

resourceName="addText"/></a>

</logic:present>

You will have to do this for all actions you
intend to support. Check
out other related tags defined in the org.jahia.taglibs.url.* package.

Hope this helps,

Marc

-----Original Message-----

From: Cédric REYMANN [ mailto:[email protected] ]

Sent: 26 August 2005 15:27

To: [email protected]

Subject: Re: Best practices - Templates

Hi,

I have such a problem with action menus on a
page with a lot of

containers. What do you mean by "the standard
static icon" ?
How can I

use it ?

Thanks,

Cédric

Stéphane Croisier a écrit :

>

> Two tips usine Jahia 4.0 or 4.1:

> - avoid using the action menu on page
with hundreds of containers.

> This will become very slow to load.
Prefer in such a case the
standard

> static icon. (In Jahia 4.5 action menus
now use AJAX
and then are only

> called on user click)

> - Use the OSCache taglibs in order to
cache (in live mode
especially)

> the dynamic content which take time to
load (I think about the

> navigation menu - e.g. the left menu or
the top menu in the
corporate

> portal templates) or any container which
aggregate content from
other

> pages, complex filters, complex
scriptlets, call to some web
services,

> etc... Combined with the Jahia HTML
cache (but only valid for a
whole

> page) this will provide excellent perf.
(In Jahia 4.5, the Jahia
HTML

> cache is now being refactored in order
to support a lower
granularity

> = per container HTML cache so this will
be then automatically done
by

> the system).

>

> Cheers,

> Stéphane

>

> At 15:36 23/08/2005, you wrote:

>

>> Hi everyone,

>> does someone have a document
which indicates the best
practices

>> for the

>> creation of a Jahia template with
performance in mind. I seek
something

>> complementary to the
Jahia_Template_Develper guide.

>> Thanks.

>

--
Cédric Reymann
Consultant Informatique
Actimage
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.