Help with ListItExtended instance

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Help with ListItExtended instance

Post by jakovbak »

Hello everyone!
This topic started with question about News module but due to strong arguments and obvious advantages in favour of LI2, I have decided to drop News module in this particular case. So I'm opening a new topic because now I have a few issues considering LI2 only.
First, I can't get image in front-end, only a question mark gif. Images are called via GBFilePicker field.
Second, I can't get pdf icon of attached pdf documents. Pdf documents are called via GBFilePicker field but all I get in the front-end is textual path to chosen document (no link, no icon, no document, just plain text).
Third, no matter which parameter I use, I can't force my LI2 instance to sort articles by custom field called "published". It's a SelectDateTime field and it suppose to show publishing date of an article. Iirc, custom fields values could be used for sorting.

I'll be very thankful on any idea or suggestion which could help me to solve this issues.
Thank you in advance and have a nice weekend!
Jakovbak
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Help with ListItExtended instance

Post by velden »

Let me post an example template and some more information:

Example page: http://tinyurl.com/lgo6he2
LI2 is used for the large images, with text and 'lees meer' links at the top.

li2cycler.jpg

Code: Select all

{if $items|@count > 0}
  <!-- cycler -->
   			  
  <div id="cyclewrapper">
  <a id="cycle-prev" class="cycle-button hover-trans"><img src="{uploads_url}/template/images/prev.png" width="67" height="67" alt="" /></a>
  <a id="cycle-next" class="cycle-button hover-trans"><img src="{uploads_url}/template/images/next.png" width="67" height="67" alt="" /></a>
  <div id="cycle-content-wrapper">
    <div id="cycle-content" class="shadow-box">
	<!-- items -->
	{foreach from=$items item=item}

 <div class="cycle group">
   <img src="{CGSmartImage src=$item->fielddefs.afbeelding.value filter_croptofit='670,326' noembed=1 notag=1}" width="670" height="326" alt="{$item->title}" />
					<div class="cycle-text">
					  <h2>{$item->title}</h2>
{$item->fielddefs.tekst.value}
{if $item->fielddefs.doelpagina.value}<div class="cycle-more"><a href="{cms_selflink href=$item->fielddefs.doelpagina.value}">>>&nbsp;lees meer</a></div>{/if}
</div>
</div>
 <!-- item -->
	<!-- item //-->
	{/foreach}
	<!-- items //-->

  </div></div></div>
  <!-- EOF cycler -->
{/if}
In the template above I used CGSmartImage module to make sure that images are cropped to the exact size that is needed.

In your case you don't need that because you link to a PDF.
Make sure you upload a PDF icon to the uploads/images directory and then use this code to create the PDF link (did not test)

Code: Select all

<a href="{uploads_url}/{$item->fielddefs.YOURALIAS.value}"><img src="{uploads_url}/images/YOURPDFICON.jpg" alt="pdf icon" /></a>
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Help with ListItExtended instance

Post by jakovbak »

Velden,
you have just turned an average weekend into a great one! Even more, I was so occupied with those issues I've completly forgot about CGSmartImage! Now it's implemented to and everything works like a charm!
Only that bloody sorting thing is left unsolved but I'll make it work, one way or another.
I won't close this topic yet, just in case...
Soon I'll need a bigger refrigerator... For all that beer that's waiting for you... :-D
Have a nice weekend my friend and good night!
Jakovbak
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Help with ListItExtended instance

Post by velden »

About the sorting thing: IIRC LI2 saves every (custom) field value as a string in the database. So the sorting will be done with the strings instead of real datetime.

I didn't realize date-sorting would be important in this case.

You could change the field to a normal text input field and ask for input format: yyyymmdd
Or you can change order of items manually by drag and drop (remember to press 'Save order' button at the right bottom after doing that!)
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Help with ListItExtended instance

Post by jakovbak »

I saw a post by uniqu3 (Goran Ilic) and he said it's a bug in version 1.4 which would be solved in the next version. Until then, I guess I'll follow your advice for manual sorting. It would be no more than 10-20 old articles to be edited with pdfs. So it won't be a problem to go manual before this bug is finally fixed. But I'll keep in mind the other option if the fix won't cover date value.
Thanks again!
Regards,
Jakovbak
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Help with ListItExtended instance

Post by jakovbak »

Hello again!
After a couple of days of playing around with LI2, I can freely say it's one of the most versatile modules I have ever used! I really like it, more and more... However, it is challenging me every now and then with some unexpected issues. The latest one is how to configure Search module to show articles properly after the search.
If one is searching for certain term, after hitting "submit" there is an usual list of results and it works fine. If result link points to an article with summary and detail content - it works fine too. But if the link points to an article with only summary content and PDF document, what one gets in the front-end is only article title, date of publishing and "return" link - no summary text or PDF!
I don't know if it's my LI2 template issue or Search module should be configured differently. I have tried many different approaches - with and without specified result page, with and without specific params for by module behaviour but none of it worked.
If you have some ideas you're more than welcome!

Best regards,
Jakovbak

P.S.
BTW, I have asked for anti-dating for some LI2 articles and Velden suggested a solution. No problem with me and it works just like he said it would but I've decided to drop that because of editor's "piece of mind"... So I have told him to send me an e-mail whenever he needs an article to be anti-dated (Reminder: I'm talking about migrated articles from News to LI2 module in case if PDF has to be added to an article - it cannot be done easily in News module unless editor is approved to mess around with the code. And it's not the case here!). now, if I receive such e-mail, I go straight to phpMyAdmin and then to LI2 items DB and then I change the date of publishing there. A little more work for me but now the date is hard-coded and it can be used in module or any other place on the site for sorting, tracking, filtering or whatever!

Anyway, this might help someone with the same problem or this may be a request for a new version of LI2 in the future... :-D
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Help with ListItExtended instance

Post by jakovbak »

No ideas? Nothing? Anyone? I'll keep on digging...
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Help with ListItExtended instance

Post by velden »

But if the link points to an article with only summary content and PDF document, what one gets in the front-end is only article title, date of publishing and "return" link - no summary text or PDF!
Could it be that in your (default?) LI2 detail template you don't show those items. Maybe because you don't offer a 'detail' link for items with PDF document. But I suspect News module to link to detail view.

A lot of guessing though.
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Help with ListItExtended instance

Post by jakovbak »

I'd love to check what you have mentioned but I have no electric power right now!!! Must be something about Christmas decorations in the streets and I don't know how long it would take... But once I get it back... :-) At least I have my mobile so I can surf around...
Post Reply

Return to “Modules/Add-Ons”