Jump to content

self built news feed


rolspace.net
 Share

Recommended Posts

Hi everyone

I've started to build a newsfeed for a customer, but I'm stuck...

I have a news-repeater field including date, title, text and images. I have the link (showing date and title) to each news on the left (with foreach) and the details on the right (showing date, title, text and images also with foreach). I would love to only show the current news on the right. The latest news should be visible on the right. When I click on the link on the left side, it should change the news content on the right side.

Does anyone have a simple solution for this? Here's how it looks like at the moment: http://rolspace.net/hd/energiegossau/uber-uns/news/

Thank you!

Roli

Link to comment
Share on other sites

comments:

1) You might want to consider using pages instead of repeater for news items (repeaters are not really meant for infinitely scaling content types)
2) Sounds like you want to use ajax to change the content of the news article that was clicked on, on the left side? - maybe take a look at this: http://barbajs.org/

  • Like 2
Link to comment
Share on other sites

When I create subpages (news-items) and make news a parent, news is not clickable anymore, it just creates an empty anchor "#". I'm using simplemarkupnavigation. any idea how I can make "news"-menulink accesible again?

found the solution...

Edited by rolisx
Link to comment
Share on other sites

19 hours ago, Macrura said:

comments:

1) You might want to consider using pages instead of repeater for news items (repeaters are not really meant for infinitely scaling content types)
2) Sounds like you want to use ajax to change the content of the news article that was clicked on, on the left side? - maybe take a look at this: http://barbajs.org/

Thanks Macrura, I changed the news items as subpages now. But I'm still left with the same problem. I don't know how to fill my news container with the content when I click on the links. I've tried using AJAX but I guess, I just don't know how. barbajs also seems way to complicated for me. Any ideas?

Where I'm at:

I have news-items containing date, title, text and images. on the right side, I have links containing date and title. When one of the links is clicked, the container is supposed to fill with the right news details.

Any ideas anyone?

Link to comment
Share on other sites

I would just do a normal page for news ; your sidebar and main content would be separate things, and then your news template shows the $page->body, this way the news pages are indexable, and bookmarkable.

the links need to links to the ->url parameter,so if you are foreaching the news items on the sidebar as $item, then the href is $item->url;

  • Like 1
Link to comment
Share on other sites

2 hours ago, Macrura said:

I would just do a normal page for news ; your sidebar and main content would be separate things, and then your news template shows the $page->body, this way the news pages are indexable, and bookmarkable.

the links need to links to the ->url parameter,so if you are foreaching the news items on the sidebar as $item, then the href is $item->url;

Thanks for the input. It works.

Have a great day!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...