WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.

Donate with PayPal buttonSpenden mit dem PayPal-Button

  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Snippet: cwsoft-anynews
  • Print
Pages: 1 ... 8 9 [10]   Go Down

Author Topic: Snippet: cwsoft-anynews  (Read 406993 times)

Offline jacobi22

  • Betatester
  • **
  • Posts: 5921
Re: Snippet: cwsoft-anynews
« Reply #225 on: December 20, 2016, 01:40:07 PM »
the code from dbs is part of the twig-version -> {{ news.GROUP_IMAGE }},  see the double brackets here. your version is older and use phplib. twig and phplib are "translators" for the placeholders and different methodes, not possible, to mix it. phplib use a single brackets like {} or [] around a placeholders. the most templates in the wb-backend using phplib, newer modules like new wrapper, mod_multilingual using twig
in attachement a older version of anynews, the latest before cwsoft stops this project here. is has twig as thirthparty onboard, so its possible to run in older wb-versions without twig in the package.
twig is now part of wb since SP4 (?)

in this version i use another parameter called start_item. thia parameter make it possible, to start the output somewher in the loop of the news. for example: a first standard function call show's the first 5 elements of the news, in a second call, i use the start_item-parameter with the value == 6, it means: show me the X next elements, but start at element number 6.

here some  examples code for the output, using in a project in different sections, first call run's in a slider and shows only special news for this slider

at first a standard call
show all item from group = 2, in display_mode = 4, order=descending, max lenght = 170 chars
Code: [Select]
[[getNewsItems?group_id=2&display_mode=4&max_news_items=999&sort_by=1&sort_order=1&max_news_length=170&allowed_tags=<p><a><img><strong>]]
after a wysiwyg section, a block with only 4 news in a teaser line
next a limit of 4
show only 4 news from group 1
Code: [Select]
[[getNewsItems?group_id=1&display_mode=5&max_news_items=4&sort_by=1&sort_order=1&start_item=0&not_older_than=999&max_news_length=150]]

after a grafic element, i need some more news in a second teaser block
the example with the start item
show maximal two news from group_id = 1, start with number 4
Code: [Select]
[[getNewsItems?group_id=1&display_mode=5&max_news_items=2&sort_by=1&sort_order=1&start_item=4&not_older_than=999&max_news_length=150]]
Logged

Offline rumen

  • Posts: 480
  • Gender: Male
Re: Snippet: cwsoft-anynews
« Reply #226 on: December 21, 2016, 01:02:09 PM »
I did it with the old ver. Somehow I could make it with some formating, group picture (all posts will use one and the same, but ...) . It is not exactly as I wished, but it is ok!

Will look something like that:



Thanks for the help!
Logged

  • Print
Pages: 1 ... 8 9 [10]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Snippet: cwsoft-anynews
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2