sam,

check whether the values are coming correctly by printing

${productContentWrapper.get("DESCRIPTION")?if_exists}
than use with ?exists ?hascontent and see what it prints.

thanks
prasath. r

On Mon, Jun 20, 2011 at 3:10 PM, Sam Hamilton <[email protected]> wrote:

> Thanks for the help but that didn't work either!?
>
> If the long_description is called first then where there is a long
> description on a product it shows the long description but does not show the
> description on products where there is no long description and only a
> description and most annoyingly if the description is called first then it
> shows description but not the long description on products that don't have a
> description but do have a long description.
>
>
> Sam
>
> On 20 Jun 2011, at 17:16, prasanth r wrote:
>
> > sam,
> >
> > I hope we cannot use has_content with not existing variables. So, I
> suggest
> > to use 'exists' before has_content
> >
> > #if productContentWrapper.get("DESCRIPTION")?exists?has_content>
> >                   ${productContentWrapper.get("DESCRIPTION")}
> > <#else>
> > ${productContentWrapper.get("LONG_DESCRIPTION")}
> >
> >> </#if>
> >
> >
> > best wishes
> > prasath.r
> > 9442369696
> >
> > On Mon, Jun 20, 2011 at 2:42 PM, Sam Hamilton <[email protected]> wrote:
> >
> >> Hi Prasath
> >>
> >> Thanks for pointing that out so the revised code should look something
> like
> >> this so that if there is no content in description is uses
> long_description?
> >>
> >>       <#if productContentWrapper.get("DESCRIPTION")?has_content>
> >>           ${productContentWrapper.get("DESCRIPTION")}
> >>           <#else>
> >>           ${productContentWrapper.get("LONG_DESCRIPTION")}
> >>        </#if>
> >>
> >> Sam
> >>
> >>
> >> On 20 Jun 2011, at 16:56, prasanth r wrote:
> >>
> >>> Hi sam,
> >>>
> >>> 'exists' will check for existence of the variable.
> >>> 'if_exists' will check for 'null' value.
> >>> if you want to check the value then use has_content.
> >>>
> >>> I hope it will help you.
> >>>
> >>> prasath
> >>> 9442369696
> >>>
> >>>
> >>>
> >>>
> >>> On Mon, Jun 20, 2011 at 2:20 PM, Sam Hamilton <[email protected]> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> Can someone help me with this if statement - i can only get it to
> return
> >> a
> >>>> value for long_description if one exists where as I want it to return
> a
> >>>> description if no long_description is found?
> >>>>
> >>>>          <#assign prodDesc =
> >>>> productContentWrapper.get("LONG_DESCRIPTION")?if_exists>
> >>>>          <#if prodDesc?exists>
> >>>>              ${productContentWrapper.get("LONG_DESCRIPTION")}
> >>>>          <#else>
> >>>>              ${productContentWrapper.get("DESCRIPTION")?if_exists}
> >>>>          </#if>
> >>>>
> >>>>
> >>>> Thanks
> >>>> Sam
> >>>>
> >>>>
> >>>>
> >>
> >>
>
>

Reply via email to