Display "featured" info on every "detail" page?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 2, 2009   (RSS)

By dwellingproductions - March 31, 2009

Hi! I have another question in regard to this member area I'm setting up for a client. Again, I have a multi-record set up where each record contains member information. Each member has an individual page which displays information specific to them that comes from their individual multi-record listing. (Additionally, each member page displays "global" organization information, such as a welcome message, etc.)

What my client wants is a way to have information from a "featured" member appear on every individual members page. This would be like a "member of the month" sort of idea, where a member would see the name, an image, and a point value of the "featured" member on their individual page, in addition to their own personal information which displays on another portion of the page.

The easy way for me to do this, obviously, is to add featured member fields in the "global" single-record which contains the client-supplied content (such as the welcome message), and have the client manually put the featured member information into those fields each month, or whenever he wants to update this. However, it would be a much more elegant solution, if, instead of having to re-enter data (and an image, etc) for the featured member each time they want to make a change, they could simply check a "featured" checkbox in the multi-record entry for the member they want to highlight that month, and have data from just that "featured" member be placed onto everyone's member page.

Is that possible? Does that even make any sense? :-)

Thanks so much!

Jeremy
---------------------------

Dwelling Productions

www.dwellingproductions.com

Re: [ross] Display "featured" info on every "detail" page?

By dwellingproductions - April 2, 2009 - edited: April 2, 2009

Ross,

Thanks! Worked like a charm! I hadn't thought about "including" a different page. That trick is going to come in really handy. :-)

For anyone else that may need to know this in the future, I'll post the code I ended up using:

----------------------------------------------------------------------------------------------------

1. On the new "featured" page (in the PHP section before the "head" tags):

list($membersRecords, $membersMetaData) = getRecords(array(
'tableName' => 'members',
'limit' => '1',
'orderBy' => 'featured',
'allowSearch' => '0',
'where' => 'featured = 1',
));



2. On the page the "featured" page was going to be displayed on, I put the following code where I wanted the content from the other page to appear:

<?php include 'featuredMember.php'; ?>

----------------------------------------------------------------------------------------------------



Thanks again Ross!

Jeremy
---------------------------

Dwelling Productions

www.dwellingproductions.com