11 years ago
8
Topic
Hello guys,

I wonder how I can put a list in which the first item is printed differently, with other fields. I know it's not something difficult to code but I could not make if in php, I think I did incorrectly. This image shows how it should be the end reultado, the first result is a picture but the second result on only has a name and title.



Thanks for the help as always.

Get a Book for SEBLOD
188 Posts
uriel
11 years ago
0
Level 1
Hello, I also want to know how to do this!The SEBLOD is very good, but some things we can not learn to do

thank you very much.

hugs
175 Posts
webcastor
11 years ago
1
Level 1
Have you considered CSS :nth-of-type(first) or :nth-child(first)?
11 years ago
0
Level 2
I could do this with CSS I know, but by then it would be an ugly hack, because it would have to load 5 images and show only one. I do not want those images to be loaded mainly because of site performance.
175 Posts
webcastor
11 years ago
1
Level 1
What if you include another field that is there just to tell the template override to display it as a picture, and all items that do not meet that condition display just the title.
11 years ago
0
Level 2
webcastor I've tried to use two different modules, but one I put to just get one item (the first) but then I have another problem that has to do with the same thing: print only the second item onwards.
188 Posts
uriel
11 years ago
0
Level 1
Can anyone help?I
t's something that has to do with programming and Secrets SEBLOD!

someone!
175 Posts
webcastor
11 years ago
0
Level 1
My suggestion was to have an additional field in the content type, which ask you if your content is to be displayed as image.
The following step would be to create an Intro template override that tests the value of the previously mentioned field and based on the value displays the position fields or just the image. Of course, your (single) content view will not be affected.
If you want this to happen automagically for just the first item in the list, regardless of the type, maybe you should start looking into some way to have an auto-incremented value, which would be tested in an Intro position override.
10 years ago
0
Level 1
Hi,

I would use a template variation that would set and check a static php variable. If the variable is not set, load the image and set the variable for the next item.

Olivier
Get a Book for SEBLOD