Template

Difference between revisions of "Feed"

Admin
Admin (talk | contribs) (Created page with "<includeonly><div class="feed-item"> <a href="{{fullurl:{{{page}}}}}" class="feed-item-link"> <div class="feed-item-thumb" style="background-image:url('{{filepath:{{{image|}}}}}');"> <div class="feed-item-title"><h3>{{{title}}}</h3></div> </div> <div class="feed-item-desc">{{{desc|}}}<span class="feed-item-more">More »</span></div> </a> </div></includeonly><noinclude> Renders one feed card. Called automatically by {{tl|Feed}} — you should no...")
 
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div class="feed-item">
<includeonly>{{#feedonce:}}<div class="feed-block feed-mode-{{{mode|preview}}} feed-style-{{{style|overlay}}} {{#if:{{{cols|}}}|feed-cols-{{{cols}}}}} {{#if:{{{postbuttons|}}}|feed-postbuttons}} {{#if:{{{actions|}}}|feed-actions}} {{#if:{{{box|}}}|feed-boxed}} {{{class|}}}"><div class="feed-header"><h2 class="feed-title">{{#if:{{{viewall|}}}|[[{{{viewall}}}|{{{title}}}]]|{{{title}}}}}</h2>{{#ifeq:{{{feedctapos|top}}}|bottom||{{#if:{{{feedcta|}}}|<span class="feed-feedbtn">[{{{feedcta}}} {{#if:{{{feedctalabel|}}}|{{{feedctalabel}}}|View all}}]</span>}}}}</div><div class="feed-items">{{#if:{{{tag|}}}|{{#dpl:linksto=Tag:{{{tag}}}
  <a href="{{fullurl:{{{page}}}}}" class="feed-item-link">
|count={{#if:{{{count|}}}|{{{count}}}|3}}
    <div class="feed-item-thumb" style="background-image:url('{{filepath:{{{image|}}}}}');">
|order=descending
      <div class="feed-item-title"><h3>{{{title}}}</h3></div>
|ordermethod={{#switch:{{{sort|}}}|created|new|newest=firstedit|#default=lastedit}}
    </div>
|include={FeedData{{!}}FeedItem}
    <div class="feed-item-desc">{{{desc|}}}<span class="feed-item-more">More &raquo;</span></div>
|notcategory={{{exclude|NoFeed}}}
  </a>
|notcategory=Private
</div></includeonly><noinclude>
|format=,<div class="feed-item">,{{#if:{{{cta|}}}|<span class="feed-item-feedcard-btn">[{{{cta}}} {{#if:{{{ctalabel|}}}|{{{ctalabel}}}|Learn more}}]</span>}}</div>,
Renders one feed card. Called automatically by {{tl|Feed}} — you should
}}|{{#if:{{{category|}}}|{{#dpl:category={{{category}}}
not normally need to type this template directly.
|count={{#if:{{{count|}}}|{{{count}}}|3}}
|order=descending
|ordermethod={{#switch:{{{sort|}}}|created|new|newest=firstedit|#default=lastedit}}
|include={FeedData{{!}}FeedItem}
|notcategory={{{exclude|NoFeed}}}
|notcategory=Private
|format=,<div class="feed-item">,{{#if:{{{cta|}}}|<span class="feed-item-feedcard-btn">[{{{cta}}} {{#if:{{{ctalabel|}}}|{{{ctalabel}}}|Learn more}}]</span>}}</div>,
}}|{{#if:{{{namespace|}}}|{{#dpl:namespace={{#ifeq:{{{namespace}}}|Main||{{{namespace}}}}}
|count={{#if:{{{count|}}}|{{{count}}}|3}}
|order=descending
|ordermethod={{#switch:{{{sort|}}}|created|new|newest=firstedit|#default=lastedit}}
|include={FeedData{{!}}FeedItem}
|notcategory={{{exclude|NoFeed}}}
|notcategory=Private
|format=,<div class="feed-item">,{{#if:{{{cta|}}}|<span class="feed-item-feedcard-btn">[{{{cta}}} {{#if:{{{ctalabel|}}}|{{{ctalabel}}}|Learn more}}]</span>}}</div>,
}}|{{#dpl:namespace=
|count={{#if:{{{count|}}}|{{{count}}}|3}}
|order=descending
|ordermethod={{#switch:{{{sort|}}}|created|new|newest=firstedit|#default=lastedit}}
|include={FeedData{{!}}FeedItem}
|notcategory={{{exclude|NoFeed}}}
|notcategory=Private
|format=,<div class="feed-item">,{{#if:{{{cta|}}}|<span class="feed-item-feedcard-btn">[{{{cta}}} {{#if:{{{ctalabel|}}}|{{{ctalabel}}}|Learn more}}]</span>}}</div>,
}}}}}}}}</div>{{#ifeq:{{{feedctapos|top}}}|bottom|{{#if:{{{feedcta|}}}|<div class="feed-footer"><span class="feed-feedbtn">[{{{feedcta}}} {{#if:{{{feedctalabel|}}}|{{{feedctalabel}}}|View all}}]</span></div>}}}}</div></includeonly><noinclude>
'''Feed''' shows the newest pages as a row of cards. Type it on any page:
 
<pre>
{{Feed
|title=Latest Camping Blog Posts
|category=Camping
|count=3
|viewall=Feed:Camping
}}
</pre>
 
'''Which pages:''' <code>category</code> (one category name) or <code>namespace</code>. If neither is given, the feed shows the newest pages in the main (article) namespace (<code>namespace=Main</code> means the same). <code>count</code> = how many cards: any whole number (3, 6, 9, 12, 15, 7 ...); it does not have to match <code>cols</code>, and the last row is simply shorter. <code>sort=created</code> = newest ''created'' first and never changes when a page is edited; leave it out (or <code>sort=edited</code>) = most recently ''edited'' first, so an edited page jumps to the top.
 
'''Look:''' <code>style</code> = (leave blank), <code>overlaytop</code> or <code>side</code>. <code>cols</code> = 1 to 5 columns (default 3). <code>actions=1</code> = show like/share icons. <code>mode</code> = preview or full. <code>viewall</code> = the page the title links to.
 
'''Keyword feed:''' <code>tag=camping</code> shows every page tagged #camping (instead of <code>category</code>).
 
'''Extras:''' <code>box=1</code> = grey rounded box around the feed. <code>class=myclass</code> = adds your own CSS class. <code>exclude=CategoryName</code> = hide pages in that category (default: pages in <code>Category:NoFeed</code> never show).
 
'''Buttons (all optional, any combination):'''
* <code>postbuttons=1</code> – each card shows its OWN button, taken from <code>cta</code> and <code>ctalabel</code> in that post's <code><nowiki>{{FeedData}}</nowiki></code> line.
* <code>cta</code> and <code>ctalabel</code> – ONE button repeated on every card (same link and text on all). The label cannot contain a comma.
* <code>feedcta</code> and <code>feedctalabel</code> – ONE button for the whole feed, beside the title. Add <code>feedctapos=bottom</code> to put it under the cards instead.
 
Every web address must be complete, starting with <code>https://</code>.
</noinclude>
</noinclude>

Latest revision as of 03:57, 28 October 2026

Feed shows the newest pages as a row of cards. Type it on any page:

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

Which pages: category (one category name) or namespace. If neither is given, the feed shows the newest pages in the main (article) namespace (namespace=Main means the same). count = how many cards: any whole number (3, 6, 9, 12, 15, 7 ...); it does not have to match cols, and the last row is simply shorter. sort=created = newest created first and never changes when a page is edited; leave it out (or sort=edited) = most recently edited first, so an edited page jumps to the top.

Look: style = (leave blank), overlaytop or side. cols = 1 to 5 columns (default 3). actions=1 = show like/share icons. mode = preview or full. viewall = the page the title links to.

Keyword feed: tag=camping shows every page tagged #camping (instead of category).

Extras: box=1 = grey rounded box around the feed. class=myclass = adds your own CSS class. exclude=CategoryName = hide pages in that category (default: pages in Category:NoFeed never show).

Buttons (all optional, any combination):

  • postbuttons=1 – each card shows its OWN button, taken from cta and ctalabel in that post's {{FeedData}} line.
  • cta and ctalabel – ONE button repeated on every card (same link and text on all). The label cannot contain a comma.
  • feedcta and feedctalabel – ONE button for the whole feed, beside the title. Add feedctapos=bottom to put it under the cards instead.

Every web address must be complete, starting with https://.