Template

Difference between revisions of "Feed"

Line 3: Line 3:
     {{#if:{{{viewall|}}}|[[{{{viewall}}}|{{{title}}}]]|{{{title}}}}}
     {{#if:{{{viewall|}}}|[[{{{viewall}}}|{{{title}}}]]|{{{title}}}}}
   </h2>
   </h2>
   <div class="feed-items{{#if:{{{cols|}}}| feed-grid}}"{{#if:{{{cols|}}}| style="--feed-cols:{{{cols}}}"}}>
   <div class="feed-items">
{{#dpl:
{{#dpl:
category          = {{{category|}}}
category          = {{{category|}}}
Line 11: Line 11:
order              = descending
order              = descending
ordermethod        = lastedit
ordermethod        = lastedit
format            = ,{{FeedItem|page=%PAGE%|title=%TITLE%|image={{#var:feedimage}}|desc={{#var:feeddesc}}|style={{{style|overlay}}}|cta={{{cta|}}}|ctalabel={{{ctalabel|}}}|actions={{{actions|}}}\n}},,
format            = ,{{FeedItem|page=%PAGE%|title=%TITLE%|image={{#var:feedimage}}|desc={{#var:feeddesc}}\n}},,
}}
}}
   </div>
   </div>
</div></includeonly><noinclude>
</div></includeonly><noinclude>
'''Usage (unchanged parameters):'''
'''Usage:'''
* title, category, namespace, exclude, count, mode, viewall — same as before.
 
'''New optional parameters:'''
* '''cols''' — number of columns on wide screens. Leave blank for the
  original default (3, via the existing flexible layout). Set to a
  number (e.g. <code>cols=2</code> or <code>cols=4</code>) to use a
  strict grid with that many columns instead.
* '''style''' — visual style of each card:
** (blank / not set) — original look: title overlaid on the photo,
  description below it. Unchanged from before.
** <code>overlaytop</code> — title across the TOP of the photo,
  description across the BOTTOM of the photo (both over the image).
** <code>side</code> — photo alone on the left, title and description
  stacked on the right, nothing written over the image. Intended for
  one-column "view all" style pages.
* '''cta''' — a URL. If set, adds a small button to every card in this
  feed. Combine with '''ctalabel''' for the button's text (default:
  "Learn more").
* '''actions''' — set to <code>1</code> to add placeholder like/share
  icon buttons to every card in this feed. (These are visual only —
  no click behavior is wired up yet, since the action wasn't defined.)
 
'''Examples:'''
<pre>
<pre>
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|mode=preview|viewall=Feed:Camping}}
{{Feed
    -> exactly like before, 3 across, title-over-image style
|title=Latest Camping Blog Posts
|category=Camping
|count=3
|mode=preview
|viewall=Feed:Camping
}}
</pre>


{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|cols=4}}
Parameters:
    -> same style, but 4 across instead of 3
* '''title''' – heading shown above the feed, and the clickable link text
 
* '''category''' – only show pages in this category (leave blank for all pages/namespace)
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=50|mode=full|style=side}}
* '''namespace''' – restrict to a namespace, e.g. ''Blog'' if you create one later
    -> "view all" page, one per row, photo left / text right
* '''exclude''' – optional category to exclude
 
* '''count''' – how many items to show (3 for homepage, higher for a "view all" page)
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|style=overlaytop|cta=https://example.com/book|ctalabel=Book Now|actions=1}}
* '''mode''' – <code>preview</code> (homepage row) or <code>full</code> (the dedicated feed page)
    -> title-top/desc-bottom over the photo, plus a "Book Now" button
* '''viewall''' – page name the title links to, showing the complete feed
      and like/share icons on every card
</pre>
</noinclude>
</noinclude>

Revision as of 20:21, 13 October 2026

Usage:

{{Feed
|title=Latest Camping Blog Posts
|category=Camping
|count=3
|mode=preview
|viewall=Feed:Camping
}}

Parameters:

  • title – heading shown above the feed, and the clickable link text
  • category – only show pages in this category (leave blank for all pages/namespace)
  • namespace – restrict to a namespace, e.g. Blog if you create one later
  • exclude – optional category to exclude
  • count – how many items to show (3 for homepage, higher for a "view all" page)
  • mode – preview (homepage row) or full (the dedicated feed page)
  • viewall – page name the title links to, showing the complete feed