Template

Difference between revisions of "Feed"

Line 4: Line 4:
   </h2>
   </h2>
   <div class="feed-items{{#if:{{{cols|}}}| feed-grid}}"{{#if:{{{cols|}}}| style="--feed-cols:{{{cols}}}"}}>
   <div class="feed-items{{#if:{{{cols|}}}| feed-grid}}"{{#if:{{{cols|}}}| style="--feed-cols:{{{cols}}}"}}>
{{#if:{{{category|}}}|{{#dpl:
{{#dpl:
category          = {{{category}}}
category          = {{{category|}}}
namespace          = {{{namespace|}}}
notcategory        = {{{exclude|}}}
count              = {{{count|3}}}
count              = {{{count|3}}}
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}}|style={{{style|overlay}}}|cta={{{cta|}}}|ctalabel={{{ctalabel|}}}|actions={{{actions|}}}\n}},,
}}|{{#if:{{{namespace|}}}|{{#dpl:
}}
namespace          = {{{namespace}}}
count              = {{{count|3}}}
order              = descending
ordermethod        = lastedit
format            = ,{{FeedItem|page=%PAGE%|title=%TITLE%|image={{#var:feedimage}}|desc={{#var:feeddesc}}|style={{{style|overlay}}}|cta={{{cta|}}}|ctalabel={{{ctalabel|}}}|actions={{{actions|}}}\n}},,
}}|{{#dpl:
namespace          = Main
count              = {{{count|3}}}
order              = descending
ordermethod        = lastedit
format            = ,{{FeedItem|page=%PAGE%|title=%TITLE%|image={{#var:feedimage}}|desc={{#var:feeddesc}}|style={{{style|overlay}}}|cta={{{cta|}}}|ctalabel={{{ctalabel|}}}|actions={{{actions|}}}\n}},,
}}}}}}
   </div>
   </div>
</div></includeonly><noinclude>
</div></includeonly><noinclude>
Usage: {{Feed|title=Latest Pages|count=3|mode=preview|viewall=Feed:AllPages}}
'''Usage (unchanged parameters):'''
Parameters: title, category, namespace, count, mode, viewall, cols, style, cta, ctalabel, actions.
* title, category, namespace, exclude, count, mode, viewall — same as before.
If neither category nor namespace is given, the feed defaults to the Main (article) namespace.
 
'''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>
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|mode=preview|viewall=Feed:Camping}}
    -> exactly like before, 3 across, title-over-image style
 
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|cols=4}}
    -> same style, but 4 across instead of 3
 
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=50|mode=full|style=side}}
    -> "view all" page, one per row, photo left / text right
 
{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|style=overlaytop|cta=https://example.com/book|ctalabel=Book Now|actions=1}}
    -> title-top/desc-bottom over the photo, plus a "Book Now" button
      and like/share icons on every card
</pre>
</noinclude>
</noinclude>

Revision as of 00:42, 14 October 2026

Usage (unchanged parameters):

  • 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. cols=2 or cols=4) 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.
    • overlaytop — title across the TOP of the photo,
  description across the BOTTOM of the photo (both over the image).
    • side — 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 1 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:

{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|mode=preview|viewall=Feed:Camping}}
    -> exactly like before, 3 across, title-over-image style

{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|cols=4}}
    -> same style, but 4 across instead of 3

{{Feed|title=Latest Camping Blog Posts|category=Camping|count=50|mode=full|style=side}}
    -> "view all" page, one per row, photo left / text right

{{Feed|title=Latest Camping Blog Posts|category=Camping|count=3|style=overlaytop|cta=https://example.com/book|ctalabel=Book Now|actions=1}}
    -> title-top/desc-bottom over the photo, plus a "Book Now" button
       and like/share icons on every card