Jump to content

Body Class of ID (alternative to {BODY_VAL} )


Guest coopersita

Recommended Posts

Guest coopersita

In the old templating system, there used to be a template tag {BODY_VAL} for adding a class or id to the body tag: <body id="{BODY_VAL}">, but that tag doesn't work anymore (I tried {$BODY_VAL}, but nothing).

Is there a new tag for that? I need it to style my site properly.

Thanks.

Link to comment
Share on other sites

Guest coopersita

What do you mean any name?

I need it to be descriptive of the page I'm currently in, like <body class="about"> or <body class="home">, therefore, it's a dynamic value.

Is there a template tag that gives a sanitized, html friendly document name?

Link to comment
Share on other sites

  • 2 weeks later...
Guest coopersita

In case anyone needs this, I found that this works:

<body id={if $SECTION_NAME == 'product'}

    "{$SECTION_NAME}_{$PRODUCT.product_id}"

	  {elseif $SECTION_NAME == 'category'}

    "{$SECTION_NAME}_{$CATEGORY.cat_id}"

	  {elseif $SECTION_NAME == 'document'}

    "{$SECTION_NAME}_{$DOCUMENT.doc_id}"

	  {else}"home"{/if}

  >

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...