Author Topic: Display a Blog menu  (Read 49811 times)

Eki

  • Guest
Display a Blog menu
« on: June 20, 2007, 11:44:17 AM »
Hi all,

For my own purpose I wanted to have a block containing a summary of the active groups and also a summary of the history per month of a certain news page. Both summaries should contain the amount of articles and a link to the news page.

So I made a snippet for it, like the AnyNews snippet. Basically I took the anynews snippet and rewrote it, including the readme file. To view the news page with a loop of articles from a certain month, I rewrote the view.php of the news module, giving it the ability to summarize the articles from that particular month (based on the published date or posted date).

I am not much of a good programmer, so the code may be a bit inefficient, but it does the job. So I decided to share it with you guys.

The whole snippet is packed, and can be installed like a module. Then the view.php of the news module needs to be replaced with the included one. After installing the menu can be called from a code section or from the template itself with the following function:

Code: [Select]
display_blog_menu($page_id,$date_option,$group_header,$history_header)
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>')

Hope someone can benefit from it also.

Cheers,
Erik

EDIT: snippet attached in next post
« Last Edit: June 20, 2007, 11:48:10 AM by Eki »

Eki

  • Guest
Re: Display a Blog menu
« Reply #1 on: June 20, 2007, 11:45:32 AM »
Of course I forgot the snippet itself (attached).

EDIT: newer version below

[gelöscht durch Administrator]
« Last Edit: February 08, 2008, 12:48:36 PM by Eki »

AzAkers

  • Guest
Re: Display a Blog menu
« Reply #2 on: August 03, 2007, 06:13:29 AM »
Sounds very close to what I'm looking for on a WB project I'm currently baking

Is there a site where this feature/module is live where we can take a look at it..?

doc

  • Guest
Re: Display a Blog menu
« Reply #3 on: August 03, 2007, 06:45:01 AM »
@Eki
Thanks for your contribution, nice module. Will test it more serious this weekend, maybe we can add it to the Add-Ons page.

Regards Christian

Eki

  • Guest
Re: Display a Blog menu
« Reply #4 on: August 20, 2007, 04:59:48 AM »
Sounds very close to what I'm looking for on a WB project I'm currently baking

Is there a site where this feature/module is live where we can take a look at it..?


Hi,

sorry for the late response, for I've been on Honeymoon the last couple of weeks. You can see a working example at my personal website
Just click "weblog"and you will see the addittion on the left column.

regards,
Eki

Offline DGEC

  • Posts: 388
  • Gender: Male
    • EbelTech homepage
Re: Display a Blog menu
« Reply #5 on: August 20, 2007, 04:05:32 PM »
So on your site you have the News Snippet with the latest posts at the top, and then the category & date summaries underneath then?

That's fantastic!   Thanks so much, and congratulations - just don't spend too much time programming instead of with your bride!  8-)

That really should be integrated into the News and/or Snippet itself.  I definitely want to add this to a site as soon as I get a multiple columns design running.

jar

  • Guest
Re: Display a Blog menu
« Reply #6 on: September 18, 2007, 11:44:08 PM »
Of course I forgot the snippet itself (attached).

hello . i try to use your snipet but does`n work 
I have News Modul v2.6.1.9

Offline XPfrik

  • Posts: 4
Re: Display a Blog menu
« Reply #7 on: October 06, 2007, 01:00:58 PM »
In include.php try to replace all active=true with active=1.

It worked for me.

AzAkers

  • Guest
Re: Display a Blog menu
« Reply #8 on: October 30, 2007, 04:16:31 PM »
Brilliant - just the thing I needed for my logofu.com blog!

Offline Usta

  • Posts: 2
Re: Display a Blog menu
« Reply #9 on: November 25, 2007, 03:48:33 AM »

@Eki,

Great module and great website.

While browsing your website I noticed your attractive photo gallery. I found design very unique and attractive. Can you please give some details on how to implement it?

Thanks!
Usta

Eki

  • Guest
Re: Display a Blog menu
« Reply #10 on: November 25, 2007, 08:26:17 AM »
@Usta,

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

regards,
Erik

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Display a Blog menu
« Reply #11 on: January 08, 2008, 09:30:56 PM »
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
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Eki

  • Guest
Re: Display a Blog menu
« Reply #12 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:

Code: [Select]
http://www.mysite.com/modules/news/rss.php?page_id=15

Hope this helps.

regards,
Erik

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Display a Blog menu
« Reply #13 on: January 22, 2008, 02:56:08 PM »
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:

Code: [Select]
http://www.mysite.com/modules/news/rss.php?page_id=15

Hope this helps.

regards,
Erik

Yes!
Lots of thanks!

Stefek
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Offline DGEC

  • Posts: 388
  • Gender: Male
    • EbelTech homepage
Re: Display a Blog menu
« Reply #14 on: February 06, 2008, 11:36:38 PM »
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.

Eki

  • Guest
Re: Display a Blog menu
« Reply #15 on: February 07, 2008, 08:40:25 AM »
@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



Eki

  • Guest
Re: Display a Blog menu
« Reply #16 on: February 07, 2008, 09:48:49 AM »
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:

Code: [Select]
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]

Offline DGEC

  • Posts: 388
  • Gender: Male
    • EbelTech homepage
Re: Display a Blog menu
« Reply #17 on: February 07, 2008, 10:50:52 PM »
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!

Offline spida

  • Posts: 203
Re: Display a Blog menu
« Reply #18 on: July 08, 2008, 10:17:17 PM »
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
« Last Edit: July 08, 2008, 10:20:22 PM by spida »

Eki

  • Guest
Re: Display a Blog menu
« Reply #19 on: July 10, 2008, 09:42:48 AM »
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
 

Offline spida

  • Posts: 203
Re: Display a Blog menu
« Reply #20 on: July 16, 2008, 07:22:43 PM »
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

  • Guest
Re: Display a Blog menu
« Reply #21 on: July 30, 2008, 09:10:31 AM »
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

Offline Luckyluke

  • Posts: 556
  • Gender: Male
  • Let's Rock
Re: Display a Blog menu
« Reply #22 on: July 30, 2008, 10:38:39 AM »
Hoi,

Congratulations on this great news!

Dikke proficiat met de dochter!

Groetjes,
Luc

Offline spida

  • Posts: 203
Re: Display a Blog menu
« Reply #23 on: August 19, 2008, 08:04:38 PM »
Any hint, what I should look for in the news.php?

Offline gemnb

  • Posts: 52
Re: Display a Blog menu
« Reply #24 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