Welcome, Guest. Please login or register.
March 21, 2010, 07:27:55 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem Website Baker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite .
110567 Posts in 15967 Topics by 9311 Members
Latest Member: tomko
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code) (Moderators: Argos, BerndJM)
| | |-+  Code Snippet: Display news items, anywhere
Pages: 1 ... 8 9 [10] 11 12 ... 19 Go Down Print
Author Topic: Code Snippet: Display news items, anywhere  (Read 65541 times)
Katerchen

Offline Offline

Posts: 84


« Reply #225 on: January 06, 2009, 05:42:10 PM »

Okay, now it works. Thank you! BTW: The snippet has vanished from the "official" code snippet page...
Logged
doc

Offline Offline

Posts: 3581


« Reply #226 on: January 06, 2009, 06:16:59 PM »

Quote
BTW: The snippet has vanished from the "official" code snippet page...
Thanks, forgot to activate the snippet - fixed.

Regards Christian
Logged
Maarten8

Offline Offline

Posts: 9


« Reply #227 on: January 13, 2009, 10:14:44 AM »

Is it possible to add it to a page?
Like if I go pages > add page?
If no, is it possible to just show it on only one page?

(really nice module btw)

Maarten
Logged
Argos
Forum administrator
*****
Offline Offline

Posts: 1349


WWW
« Reply #228 on: January 13, 2009, 10:22:18 AM »

Is it possible to add it to a page?
Like if I go pages > add page?
If no, is it possible to just show it on only one page?
Sure, make a code section and put the snippet in there. I recommend using the code2 module: http://www.websitebakers.com/pages/admin/core-replacements/code-2.php. It's more versatile than the default code module.
Logged

Jurgen Nijhuis
Argos Media
www.argosmedia.nl/portfolio (mostly WB sites)
----------------------------------------------------------------
Please don't request personal support, use the forums!
Maarten8

Offline Offline

Posts: 9


« Reply #229 on: January 13, 2009, 11:10:53 AM »

Is it possible to add it to a page?
Like if I go pages > add page?
If no, is it possible to just show it on only one page?
Sure, make a code section and put the snippet in there. I recommend using the code2 module: http://www.websitebakers.com/pages/admin/core-replacements/code-2.php. It's more versatile than the default code module.

Woah thanks for the fast response grin
Logged
VotreEspace

Offline Offline

Posts: 269


Web Dev & tickler


WWW
« Reply #230 on: January 13, 2009, 05:59:39 PM »

is there a way to link the title header to the news it's showing (when it's only 1 group)?

like in there http://www.votreespace.net/pages/nouvelles.php
the "derniere realistion" is another news in a subsection, other than making the link manualy in the call, can we activate a link to the group?

because something like this :
Code:
if (function_exists('display_news_items')) {
    display_news_items(0,10,50, 2,'<a href="/pages/nouvelles/derniere-realisations.php">Dernières mise-a-jour</a>', 'Voir...', 'oups, aucunes mise a jour');
}
do not seam to work.
Logged

doc

Offline Offline

Posts: 3581


« Reply #231 on: January 13, 2009, 06:14:35 PM »

Hello,

should be doable with the latest version of anynews released recently on the addon repository.

You can style the output of anynews by modifying the HTML templates included in the folder /htt of anynews as described in the README file.

Regards Christian
Logged
saiborg

Offline Offline

Posts: 98


WWW
« Reply #232 on: January 14, 2009, 09:42:00 PM »

Sorry, but im toooooo silly,

i can´t implement the code....i already changed some code in the anynews/include.php
but i can´t make the $max_news_length shorter

Code:
if (function_exists('display_news_items')) {
    display_news_items($max_news_length);
}


an what do i habe to change that there ist not the full short text, only thirty to fourty letters....

Code:
$group_id = 0, $max_news_items = 10, $max_news_length = -0, $display_mode = 1,         $header_text = 'Aktuel', $readmore_text = 'weiter lesen', $no_news_text = 'no news available yet...',         $strip_tags = true, $allowed_tags = '<a>',        $display_publish_date = false, $date_time_format = ' (g:i A, m/d/Y)',        $sort_by = 1, $sort_order = 1)

Thank you for your help

Saiborg
(sorry for my english)
« Last Edit: January 15, 2009, 10:01:56 AM by saiborg » Logged

schaut doch mal vorbei

http://www.microott.de
doc

Offline Offline

Posts: 3581


« Reply #233 on: January 22, 2009, 05:29:42 PM »

Hello,

just released Anynews v0.34 on the Website Baker Add-ons repository.

This version fixes a bug which made it impossible to make use of the custom output template files like: custom_output_displ ay_mode_X.htt (X for a number between 3 and 99). Thanks to Erpe for reporting.

Further details can be found in the Readme file.

Delete any previous version and install the latest version afterwards.

Have fun
Christian
« Last Edit: January 22, 2009, 05:33:20 PM by doc » Logged
Maarten8

Offline Offline

Posts: 9


« Reply #234 on: January 26, 2009, 02:31:46 PM »

Is it possible to put the anynews in a WYSIWYG page?
So if you make a new page and use as type WYSIWYG.
Because I would like it at the frontpage only (so no use to put it in template) and I kinda need to have a WYSIWYG page for some other users.

thanks.
Logged
doc

Offline Offline

Posts: 3581


« Reply #235 on: January 26, 2009, 03:12:00 PM »

Hello,

yes, simply add a WYSIWYG section and a code section to a page. Then call the Anynews function from the code section. This way you do not need to touch your template. Details about section can be found on the WB help site:
http://help.websitebaker.org/pages/en/basic-docu/working-with-wb/page-administration/manage-sections.php

Regards Christian
Logged
Maarten8

Offline Offline

Posts: 9


« Reply #236 on: January 27, 2009, 11:12:15 AM »

Hello,

yes, simply add a WYSIWYG section and a code section to a page. Then call the Anynews function from the code section. This way you do not need to touch your template. Details about section can be found on the WB help site:
http://help.websitebaker.org/pages/en/basic-docu/working-with-wb/page-administration/manage-sections.php

Regards Christian

Thanks it totally works  afro
Logged
babsy

Offline Offline

Posts: 299


« Reply #237 on: February 04, 2009, 12:33:43 PM »

hi.... i just updated, and my picture dissapeared, so now its. just text??
is it not possible in the latest update to have the picture in the small text??
Logged
doc

Offline Offline

Posts: 3581


« Reply #238 on: February 04, 2009, 05:06:26 PM »

Hello,

need to check if the striptags options are missing for the short text in the last version of Anynews.

Regards Christian
Logged
babsy

Offline Offline

Posts: 299


« Reply #239 on: February 04, 2009, 05:53:33 PM »

ok, i tried to look through the old code, but i really don´t see what code is for the picture, so if anyone knows, please let me know!
« Last Edit: February 05, 2009, 04:07:37 PM by babsy » Logged
doc

Offline Offline

Posts: 3581


« Reply #240 on: February 05, 2009, 08:40:30 PM »

Hello,

the bug should be fixed in the latest version available on the WB Add-ons repository.

Regards Christian
Logged
Ymmot

Offline Offline

Posts: 1


« Reply #241 on: February 18, 2009, 11:36:27 PM »

Hi all.
Thanks a lot for a great forum and dedicated community. Smiley
I am a fairly new user off website baker, I like it a lot!
I tweaked some files here and there and got most working like I want it.

Now to the topic:
What I would like with anynews is the ability to show news starting from news item X!

On the front page I would like to show one news item with text and 5 more with just links.

But with the code here under the first full will be the same as the first in the second group.

Any way to work around or any way it´s possible to add to the anynews code?

Code:
if (function_exists('display_news_items'))
{
display_news_items(0, 1, 230, 1, 'Latest News', 'show full news text', 'uups, no news available', true, '<a><img>', true, ' (Y-m-d)', 2, 1);

display_news_items(0, 5, 0, 2, 'More News', 'show full news text', 'uups, no news available', true, '<a><img>', true, ' (Y-m-d)', 2, 1);
}

Thanks for any tips and help!
Logged
Argos
Forum administrator
*****
Offline Offline

Posts: 1349


WWW
« Reply #242 on: February 19, 2009, 10:58:31 AM »

hi,

try it with two sections .....

first section take the "latest news" - modul from here....
http://www.websitebakers.com/pages/modules/listings/section-pages/latest-news.php

it shows the last news-post full...

second section take the anynews for the links to the rest of the news.... wink

I think the question was how to let the anynews module start with the second latest item, instead of the latest one...
Logged

Jurgen Nijhuis
Argos Media
www.argosmedia.nl/portfolio (mostly WB sites)
----------------------------------------------------------------
Please don't request personal support, use the forums!
daydreamer

Offline Offline

Posts: 149


« Reply #243 on: March 03, 2009, 12:32:04 PM »

Sorry this is all new to me, I need to show

5 posts
News Title
Short Description max 40 length
read more

What code would I need in my index.php

Many Thanks
Logged
mr-fan
Forum Team
*****
Offline Offline

Posts: 1161


skifahren...;)


WWW
« Reply #244 on: March 03, 2009, 12:37:41 PM »

http://addons.websitebaker.org/modules/anynews/help/help_en.html

try and learn about this snippet and you can get the output of the newsmodule that you want... wink

regard martin
Logged

...learn more every day! Help Project
...get your Portable -Edition-
...write your Tutorial Project
daydreamer

Offline Offline

Posts: 149


« Reply #245 on: March 03, 2009, 12:55:01 PM »

This is what I have but no short description is showing?

<?php display_news_items(0, 5, 50, 2, 'Latest News', 'read more', 'no news yet', '<a>', 'do not show publish date', '1', '1'); ?>
Logged
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[droplets]]


WWW
« Reply #246 on: March 03, 2009, 12:59:32 PM »

The 4th parameter should be set to 1.
2 means you will get a list of links only.

Quote
display_mode...    1:=details (default); 2:=unsorted list; 3-99 (custom template: /htt/custom_output_display_mode_X.htt)

Ruud
Logged

daydreamer

Offline Offline

Posts: 149


« Reply #247 on: March 03, 2009, 01:13:10 PM »

Thanks so much guys all sorted
Logged
sparkdigital

Offline Offline

Posts: 254


Once a baker, always a baker!


WWW
« Reply #248 on: March 03, 2009, 05:24:30 PM »

How does this snippet deal with the possibility that there are more than one news pages? Can I specify which page I want to display the news items from?

Thanks,

Konrad
Logged
Ruud
Development Team
******
Offline Offline

Posts: 1273


[[droplets]]


WWW
« Reply #249 on: March 03, 2009, 05:33:50 PM »

If you have multiple News pages you will need to use the group id.
Create a group for every newspage to use, and use the first parameter to show only that group.

It works fine for multilanguage sites. (used it like that before)
Groups like "Dutch news, English News, etc.."

Ruud

Logged

Pages: 1 ... 8 9 [10] 11 12 ... 19 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!