Hello again!
This LI2 is really powerful! Also, it's totally screwed up when it comes to setup!!! I have spent most of the last night trying to figure out how to make it work and finally I did it! Or, at least, I've figured out how it works... I have a few minor problems, mostly coding stuff.
Here we go (first, let me explain where I am right now)...
I have created LI2 instance named
"ListIt2Article" and it contains following fields:
- category,
- date published (select date/time type),
- article photo (select file type),
- summary content (text area type),
- detail content (text area type),
- pdf download (GBFilePicker UploadFile type).
These fields can cover all of the items from the old articles from News Module. Since I have two types of articles (one:
image+summary+detail; two:
summary+pdf document), I need some conditional calls in my template. For example: first type of article uses all fields except "pdf download field", second type of article uses all fields except "photo" and "detail". I'm using one summary and one detail template and I would like to hide fields if they are empty, I'd like to hide "More" link if there's only summary content in the article (no detail content is necessary if there is a pdf document for download), and I would really like to see the image in the front-end instead of "missing image.gif"!
Here's the part of my summary template where all the problems are:
Code: Select all
{if $fielddef.value && $fielddef.type != 'Categories'}
{if $fielddef.type == 'SelectFile' || $fielddef.type == 'FileUpload'}
<div class="itemPhoto">
<img src="{$fielddef->GetImagePath(true)}/{$field->value}"/>
</div>
{elseif $fielddef.type == 'SelectDateTime'}
<div class="itemPostdate">
{$fielddef.name}: {$fielddef.value|cms_date_format}
</div>
{elseif $fielddef.alias == 'summary'}
<div class="itemSummary">
{$fielddef.value}
</div>
{elseif $fielddef.alias == 'detail'}
<div class="itemDetail">
{$fielddef.value}
</div>
{/if}
{/if}
and this is the part of "More" link:
Code: Select all
<div class="itemMoreLink">
<a href="{$item->url}">Detaljnije...</a>
</div>
I know this can be solved with a few variables but I don't know how to write them and I have failed in "try and error" approach...
BTW, there is no problem to keep old News Module articles for awhile as well because new articles from LI2 are newer by their date of publishing and we can spend some time on migrating the old ones to LI2. Easy going task for long and cold winter nights...
So, if you can spend some time with this to provide an accurate set of vars or to tell me what am I doing wrong - please, feel free!
Best regards and thank very much you on your suggestions and help once again!
Jakovbak