Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hello all... again xD

Basically I was wondering if there was a way of making boxes that I use on the frontpage of my site update automatically with a thumbnail and title from a latest post? Rather than me manually doing it
Hi,

'Making' boxes is the HTML/CSS/JS part - that is the designer's (i.e. yours) responsibility - Couch can only help in fetching content into it.

You can show content from any template on any other template (e.g. show posts from blog.php on index.php) using <cms:pages> with its 'masterpage' parameter set to the template the pages are to be fetched from. E.g. the following will show the two latest blog posts wherever you choose to place the code -
Code: Select all
<cms:pages masterpage='blog.php' limit='2'>
    ... all variables of blog available here ..
</cms:pages>

Please see the docs on more info about <cms:pages> if you need to.
Ok so let me clarify this a bit better.

I have a box, and say when ever one my content editors posts a new thing on the review section, I want that box to automatically update in the format as followed

Thumbnail from latest Post
Title from latest post
LINK to latest post

Thumbnail from 2nd latest post
Title from 2nd latest post
Link from 2nd latest post

and so on. So basically its pulling the data from the reviews page but not everything and its all automated
The code I posted above does exactly that. Please use <cms:show> with the right variables within the <cms:pages> block and you'll always have data from the latest two posts shown.
KK wrote: The code I posted above does exactly that. Please use <cms:show> with the right variables within the <cms:pages> block and you'll always have data from the latest two posts shown.


Does this work on a carousel? I mean when you upload an image doesn't it auto crop the image or does it just overflow: hidden?
'overflow: hidden' is again something that *you* code in your markup - Couch remains agnostic about it.
As for the physical image sizes, if you wish you may ask Couch to resize or crop the image for you (please refer to the docs- https://docs.couchcms.com/tags-referenc ... image.html) or you may choose to let it remain agnostic about that too.

Eventually it is your code that will display the carousel. Please begin with a working static HTML/CSS/JS carousel design and work backwards by retrofitting Couch into it.

Please refer to the 'Aurelius' tutorial for an example of this (additionally search for 'carousel' and you'll find several posts on this forum on how to handle it)..
Ok and this one applies to the boxes initially stated but I'm trying to line up the bootstrap panels so they are in a row but I have this little light bulb that makes me things each new entry made in my blog appear line after line rather than

So rather then going

Review 1 Review 2

It goes

Review 1
Review 2.

Any clues?

Update

Solved my own problem on that one.
Rydema wrote: Ok and this one applies to the boxes initially stated but I'm trying to line up the bootstrap panels so they are in a row but I have this little light bulb that makes me things each new entry made in my blog appear line after line rather than

So rather then going

Review 1 Review 2

It goes

Review 1
Review 2.

Any clues?

Update

Solved my own problem on that one.


Ok, so far so good with my site, I was wondering is there a way of doing like a tick box that tells it to display article that is selected to display on frontpage?

So in my case I'm doing twitch streamers and say I wanted to make one of 20 people streamer of the week. Is there a way i can just make that one display?
Is there a way i can just make that one display?

Sure. Add a checkbox (unchecked to begin with) and then use <cms:pages> with 'custom_field' parameter to find the pages that have that checkbox ticked (https://docs.couchcms.com/tags-referenc ... stom_field).
9 posts Page 1 of 1
cron