Hi heg,

I can think of something like that:

10 = COA
10 {
  10 = TEXT
  10 {
    wrap = <div id="div_id" class="|">
    value = link_yes
    override = link_no
    override.if.isFalse.current = 1
  }

  20 = TEXT
  20 {
    typolink.parameter.current  = 1
    typolink.returnLast = url
    wrap = <a id="anchor_id" href="|">Link</a>
  }

  30 = TEXT
  30.value = </div>
}

It is untested but perhaps a good start. You just map the link field and wrap the surrounding div via typoscript.

Regards,
Chris.

Am 31.05.2011 12:23, schrieb heg:

Hi everybody, I'm struggling with the following scenario:

My HTML template below
     &lt;div id="div_id" class="...">
         &lt;a id="anchor_id" href="...">Link&lt;/a>
     &lt;/div>

is mapped to a templavoila DS as follows:
     - the anchor's href attribute is mapped from a link field and works just
fine
         10 = TEXT
         10.typolink {
           parameter.current = 1
           returnLast = url
         }
     - div's class attribute is defined as typoscript object path
(lib.div_class) and should be set to a certain value if the link above is
not defined.

Since the content of the link field cannot be accessed in the page template,
I've tried setting the value of div_class in the 'Data processing>
Typoscript code' section of the anchor's href, right after the typoscript
above but it doesn't work like this.

I've wasted already too much time on this and eventually decided to ask for
help on how to accomplish the task. Thank you!

_______________________________________________
TYPO3-english mailing list
TYPO3-english@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

Reply via email to