Display a Blog menu

Ruud

On my WB-Tips site I added this too.

This is used in my template. (the news-page has PAGE_ID 8 )
               
<?php if (PAGE_ID != 8) {
    
display_news_items();
} else {
    
display_blog_menu(8,1,'<h2>Onderwerpen</h2>','<h2>Historie</h2>');
}
?>



Works great - running on WB2.7.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Eki

Hi,

Page_id would be 1 then. Remember that this snippet is not working in WB2.7 yet. Also I have never tested it with the media-blog module.

To be honest I don't like the way this snippet has to be installed (even though I made it myself). It needs to have one of the original files of the news module replaced. And that is the only thing that is of any concern to me. If anybody finds another solution to this, please feel free to adapt the snippet and let me know.

regards,
Erik



ghost06

Quote from: Eki on February 07, 2008, 09:48:49 AM

Snippet works as follows:

display_blog_menu($page_id,$date_option,$group_header,$history_header,$display_option)

In which:

page_id => the news page you want to generate the menu from
date_option => 0:=summarize according posted date (default), 1:=summarize according published date
group_header => header above the group menu (default: '<h1>Categories</h1>')
history_header => header above the group menu (default: '<h1>History</h1>')
display_option =>0:=show both history and categories (default); 1:=show only history; 2:=show only categories

I do not succeed to understand what I must put in mine index.php of the template

i have the page whit page_id=1
the media blog is in the section page_id=1#69

what I must insert in mine index.php of my template ones in order to show the menu?

help me plese  :cry: :cry:

gemnb

Well, I can't find the answer (and no one else can, I assume) . So unfortunately there seems to be no solution to this one for now.
I've also tried to create the same situation in WB 2.6.7. (I'm using 2.7), but I got the same result.  :-(

Regards,
Ton

gemnb

No, but I hope I'll find a way to make it work.   :|
I only want the list to appear when I click the (my own) Archive menu button, not all of the time ( just like it is on Eki's website!).

Regards,
Ton

Stefek

Nevermind.

Will be glad if this solves your problem.  :wink:

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Stefek

Quote from: Eki on June 20, 2007, 11:44:17 AM
After installing the menu can be called from a code section or from the template itself with the following function:

display_blog_menu($page_id,$date_option,$group_header,$history_header)

Hello!
" or from the template itself" means that this is "hardcoded" into the template.  :wink:

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

gemnb

Thanks Stefek for your answer, but I'm still confused.
When looking at Eki's website, you can go to the weblog menu. On the left you see all the catagories. Clicking one of the items gives a result, but the menu stays.
This isn't hardcoded I assume?

Regards,
Ton

Stefek

Quote from: gemnb on September 15, 2008, 08:21:58 PM
Hi there,
I have a question. I implemented the blog menu in a codepage. When I click an item in the blocksection I've made, the news item appears in the contentbox but the list of history-items in the blocksection disappear (I hope you know what I mean).
How can I change it?

Regards,
Ton
Quotebut the list of history-items in the blocksection disappear
I think it's because your whole page is changed and the "CodePage" is not visible anymore.

The solution is to hardcode your code (you used in the "codePage") into your Template, so it's present all the time onevery page.

May think with this?

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden


gemnb

Hi there,
I have a question. I implemented the blog menu in a codepage. When I click an item in the blocksection I've made, the news item appears in the contentbox but the list of history-items in the blocksection disappear (I hope you know what I mean).
How can I change it?

Regards,
Ton

spida

Any hint, what I should look for in the news.php?

Luckyluke

Hoi,

Congratulations on this great news!

Dikke proficiat met de dochter!

Groetjes,
Luc

Eki

Hi @spida,

Yes I have!!!. Last friday I've become daddy of a beautiful doughter. And as both mother and doughter are still in the hospital I am indeed still very busy.

But I made a promise to adjust the snippet for WB2.7. And I will fullfill it in the near future.

regards,
Erik

spida

Hi Erik,

I know, you've become daddy again, haven't you? Congrats! That IS a busy time, indeed.

Nevertheless, thank you for the cool script and for any future add-ons.

Regards,
spida

Eki

Hi @Spida,

This is probably because of the included file view.php, which was meant for one of the older versions of teh news module. I would have to check this out, but as I am very busy at the moment this would need some time.

regards,
Erik

spida

#19
Hi Eki,

great snippet! It works instantly (well, so far  8-) )
Just commenting doesn't work anymore. On clicking the "add comment" link the user is redirected to the startpage. Any idea what I could do to enable commenting again?
I am trying to use it in WB 2.7!

Thanks in advance,
spida

DGEC

re: Display single block - excellent idea!  I was trying to figure out the best way to have a div marker between them, that's perfect.

re: Breadcrumbs - ah! I'd forgotten. Hard to tell after you've installed it already :-)

re: single post - oh!  I'll have to have another look at that, I thought it only prints the title and short_desc, not the long_desc too.

The count by published date is really nice too - I have changed mine to display by published date. Makes much more sense to me. I'll have to make sure this snip excludes future dates.

Thanks!

Eki

OK, so this was very easy. I added an extra option to show both History and Categories (Groups), or just one of them. I decided to not make an option to show them next to each other, for that would again fix the possibilities. Now it is possible to have the layout you want. So if you want to show the History and Categories next to each other, you could make two <div>-sections and use the code snippet twice, once for the categories only and once for the history only.

Snippet works as follows:

display_blog_menu($page_id,$date_option,$group_header,$history_header,$display_option)

In which:

page_id => the news page you want to generate the menu from
date_option => 0:=summarize according posted date (default), 1:=summarize according published date
group_header => header above the group menu (default: '<h1>Categories</h1>')
history_header => header above the group menu (default: '<h1>History</h1>')
display_option =>0:=show both history and categories (default); 1:=show only history; 2:=show only categories

[gelöscht durch Administrator]

Eki

@DGEC,

About the breadcrumbs: they are not part of the code snippet itself. The breadcrumbs are being generated by the news module. The change of code to the news section is been made too add breadcrumbs for a certain time-period. For example: News >> February 2008

Regarding showing the latest posts: use the code snippet "Dsiplay News Anywhere". There is also a parameter for showing the title as well as the short description.

Regarding the side-by-side option I would have to take a look back into the code and see if that can be accomplished in an easy way. I think it is a relevant requirement. Maybe adding an extra option to show them vertical or side by side.

regards,
Erik



DGEC

Thanks, this is great - it's working quite well. But....  :wink:

1) If you pick a category with no entries, you don't get the breadcrumb links.
Making the breadcrumbs optional would be a good idea too. I'm not sure I like the look of it at the bottom of the menu there. A top and/or bottom flag might be nice?

2) This is more a news question but is there a function to display the latest post by itself?  I.e. I want the News page to display 1-x most recent posts, and then display the menus after that.

I put the blog menu in a code-section at the top of the page, followed by the news section. Works ok, but not the greatest, t's kind of awkward as it is. I think I'll have to figure out how to use content blocks. I'd like to put the category & history side by side, can probably use the DIV.UL I think it was to place them in block mode.

Stefek

Quote from: Eki on January 22, 2008, 06:32:46 AM
Hello @Stefek,

The RSS-feed is dynamicallay generated. The script is already part of the news module. Just call the script with the page_id of your news or blog in the URL, like this:


http://www.mysite.com/modules/news/rss.php?page_id=15


Hope this helps.

regards,
Erik

Yes!
Lots of thanks!

Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Eki

Hello @Stefek,

The RSS-feed is dynamicallay generated. The script is already part of the news module. Just call the script with the page_id of your news or blog in the URL, like this:


http://www.mysite.com/modules/news/rss.php?page_id=15


Hope this helps.

regards,
Erik

Stefek

Hello Eki - great Modification!
I'll test it in the next day for one of my next project. Also the site itself is nice looking. My compliment!

I'd like to aks you for some advice on how to synchronize the weblog and the rss-feed, as you have done on your page.
Did you make it work automatic? Is there any mod for this purpose?

Thanks,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Eki

@Usta,

I am using the Swift Gallery, available at the Add-Ons Repository.

regards,
Erik