Re: [Tiki-devel] Tracker filter in wiki template page stopped working

Gary Cunningham-Lee <gary_c-39LOpZwlz1/[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <[email protected]>
Hi Jonny,

The thing is, for some themes $f_43 has data (an image), and some don't, 
but the theme option heading and so on shouldn't display if there isn't 
an image (because there's no theme option). The problem seems to be 
about the syntax of the "if" statement. This worked originally, then was 
edited/improved a few times, but it isn't working now.

--  Gary


On 11/12/2021 7:11 PM, Jonny Bradley via TikiWiki-devel wrote:
> Hi Gary
>
> I don't totally follow, but what's probably changed is the contents of that field somehow, so to check i usually output the field value in the template, by doing something like:
>
>
>      ===={$f_43}==== (i add the equals signs or some other char so i can see if it's empty or not)
>
> or, if you want to be more fancy, try:
>
>      <pre>{$f_43|var_dump}</pre>
>
> which will tell you the field type (string usually here), length of the string etc. It works with arrays and objects too... Roberto and i have been doing a lot of this recently, and coincidentally found this project yesterday
>
>      https://github.com/kint-php/kint
>
> which is var_dump on steroids, but it'll take a bit of integrating into Smarty... one day maybe ;)
>
> HTH
>
> jonny
>
>
>
>> On 12 Nov 2021, at 09:59, Gary Cunningham-Lee <[email protected]> wrote:
>>
>> Hi,
>>
>> At themes.t.o, there's a tracker template page (https://themes.tiki.org/Theme_page_TPL) for displaying the info on theme pages (for example, https://themes.tiki.org/Shapely). The theme option section has some filters because not all themes have theme options. This worked but isn't working now (I'm not sure when it stopped working). The template looks like
>>
>> {if $f_43 and ($f_43 ne " ")}<h3>Theme options</h3>
>>              <div class="row">
>> {if $f_43}<div class="col-xs-6 margin-bottom-sm"><img src="{$f_43}" class="img-responsive screenshot" alt="theme screenshot"><br><strong>{$f_42}</strong></div>{/if}
>> {if $f_45}<div class="col-xs-6 margin-bottom-sm"><img src="{$f_45}" class="img-responsive screenshot" alt="theme screenshot"><br><strong>{$f_44}</strong></div>{/if}
>> {if $f_47}<div class="col-xs-6 margin-bottom-sm"><img src="{$f_47}" class="img-responsive screenshot" alt="theme screenshot"><br><strong>{$f_46}</strong></div>{/if}
>> {if $f_49}<div class="col-xs-6 margin-bottom-sm"><img src="{$f_49}" class="img-responsive screenshot" alt="theme screenshot"><br><strong>{$f_48}</strong></div>{/if}
>> {if $f_51}<div class="col-xs-6 margin-bottom-sm"><img src="{$f_51}" class="img-responsive screenshot" alt="theme screenshot"><br><strong>{$f_50}</strong></div>{/if}
>>              </div>
>> {/if}
>>
>> where field 43 and the other odd-numbered fields are theme option screenshot image files, and the even numbered fields are theme option names.
>>
>> It seems that the "if" syntax for a tracker's wiki template page has changed, or something has, so what was working to show/not show the layout and field data isn't working now. Does anyone have any information about this?
>>
>> -- Gary
>>
>>
>>
>> _______________________________________________
>> TikiWiki-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
>
>
> _______________________________________________
> TikiWiki-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.