Dynamic Body ID

Dynamic Body ID

Thursday 12 May 2005 4:58:04 pm - 5 replies

Author Message

Nathan Kelly

Thursday 12 May 2005 5:05:34 pm

Oh one more thing, this code seems to do the same thing-

{let page_name=fetch( content, node, hash( node_id, $module_result.node_id ) )}

<body id="{$page_name.url_alias}">
{/let}

As I said I am not very familiar with the syntax so I really have no idea what the difference is with these 2 snippets.

cheers.

Pardon me while I burst into flames...

Xavier Dutoit

Friday 13 May 2005 12:50:24 am

Hi,

I'd suggest not to use the url_alias on the css (they can be modified by the user, but the node id

eg <div id="node_{$node.node_id}">

would produce id="node_2"

X+

http://www.sydesy.com

Nathan Kelly

Friday 13 May 2005 1:16:53 am

Thanks for your reply Xavier,

I had originally intended to use the node id but I was unsure if this would be the best way, and now that you mention it, it seems more logical as I hadn't considered the lack of persistence in the url_alias.

On that note just for my own clarification, is the node id persistent, that is will it ever change and if so what action would likely do so?

Cheers!

Pardon me while I burst into flames...

Roy Bøhmer

Friday 13 May 2005 5:32:00 am

The node-id is persistent, BUT an article can exist on several different places in the node-tree and therefore have several different node-ids.

A scenario could be that you
1)Publish an article with node-id=100.
2)Make a co-location of the same article, and now have node_id=100 AND node-id=200.
3)Then you make node-id=200 the primary node, and delete the node-id=100.
Now you only have node-id=200. If you use node-id in the url it will seems like the article has changed node-id.

Object-id on the other hand will be persistent.

Roy

Nathan Kelly

Sunday 15 May 2005 5:25:05 pm

Ok, thanks for that info Roy that clears up my main question for now but I'm sure I will have plenty more to come yet ;).

Cheers.

Pardon me while I burst into flames...

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.