Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17480 Posts in 4474 Topics by 1973 members

Archive

SilverStripe Forums » Archive » check variables

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: check variables 321 Views
  • fiord
    avatar
    Community Member
    37 posts

    check variables Link to this post

    hi
    How can I check in the template *.ss one of the variables if it is empty?
    I try

    <% if Linkwww %>
    <div class="Linkwww"><a href="http://{$Linkwww}">$Linkwww</a></div>
    <% end_if %>

    but nothing goes

  • Piklets
    avatar
    Community Member
    32 posts

    Re: check variables Link to this post

    How are you defining your variable?

    Test it out with:
    <% if Content %>
    This page has content!
    <% end_if %>

    That should work.

    --

    If blocks (http://doc.silverstripe.com/doku.php?id=templates)

    <% if Property %>
    <% end_if %>

    If blocks let you mark off optional content in your template. The optional content will only be shown if the requested field / method returns a nonzero value.

  • fiord
    avatar
    Community Member
    37 posts

    Re: check variables Link to this post

    thanks
    But as it turned out the problem in another

    l have next code on my ProdHolder.ss
    <% control Children %>
    <div class="ProdBl">
       <div class="prev"><a href="$Link" title="$Title.XML">$Photo.SetWidth(150)</a></div>
       <div class="Prodtext">
          <h4><a href="$Link" title="$Title.XML">$Title</a></h4>
          $Content
          $Linkwww
          <% if Linkwww %>
          <div class="Linkwww"><a href="http://{$Linkwww}">$Linkwww</a></div>
          <% end_if %>
       </div>
       <div class="clear1"><!-- --></div>
    </div>
    <% end_control %>


    my ProdHolder.ss does not see $Linkwww from Children Pages

    321 Views
Page: 1
Go to Top

Currently Online: Talby, SmartPlugsDesign, kateh

Welcome to our latest member: AlfonsoGrondo

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.