Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Tracking the appearence of a page item inside another page


Go to End


2 Posts   1787 Views

Avatar
gMentat

Community Member, 2 Posts

10 February 2010 at 2:11am

Edited: 10/02/2010 2:11am

Well this is what I want to do

Let's say I have a HomePage and a NewsPage. On my HomePage I show two(2) random NewsPage pages (the title and a preview). I need to track how many times a NewsPage page item has appeared in my HomePage. Is this possible ??

Thank you in advance

George

Avatar
baba-papa

Community Member, 279 Posts

10 February 2010 at 8:26am

Create a new property for your NewsPage ($db). There must be a controller method in your HomePage_Controller that is responsible for displaying those two NewsPages. Let that method increment the new property of NewsPage.