One Section Editor, Multiple Viewer URL's -- Possible?

7 posts by 3 authors in: Forums > CMS Builder
Last Post: August 31, 2009   (RSS)

By gagester - June 30, 2009 - edited: June 30, 2009

Hello, We have one "section" of a website that we want viewable in two areas of the site.

We'd like each place it's viewable to display it slightly differently. (one will be more of an expanded view of the information... additional photo downloads, etc.)

It's a list of articles. When I add the code to my 'second viewer page', it links to the detail page for the original page.

E.g.:

/who-we-are/client-stories.php
/who-we-are/client-story_Detail.php

/members/client-stories.php <-- the detail link for this page links to /who-we-are/client-story_Detail.php instead of:
/members/client-story_Detail.php

I realize this is because of the View URL settings in the Admin > Section Editors area.

But is there any way I can get this to work without making the client have to enter the same content twice?

let me know if you have any solutions!

thanks
[:)]

Re: [gagester] One Section Editor, Multiple Viewer URL's -- Possible?

By ross - July 3, 2009

Hi there.

Thanks for posting!

You can actually have details from one section displayed on as many different pages as you like. In a situation like what you are describing, you may end up needing to hardcode the links to the detail page though.

Does that help? Let me know if you'd like to go over this in more detail :).

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] One Section Editor, Multiple Viewer URL's -- Possible?

By gagester - July 3, 2009

hardcode the links to the detail page?

yes, please explain more...

Re: [gagester] One Section Editor, Multiple Viewer URL's -- Possible?

By ross - July 6, 2009

Hi there.

Because you are using the same file name for your detail page and just having it in a different folder, this should be fairly straight forward I think.

What you'll do is instead of using the usual link like this:

<a href="<?php echo $record['_link']; ?>">

Use something like this instead:

<a href="client-story_Detail.php?<?php echo $record['title'] . "-". $record['num']; ?>"

That should get you going. Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] One Section Editor, Multiple Viewer URL's -- Possible?

By gagester - August 31, 2009 - edited: August 31, 2009

Okay... I'm definitely not catching on to php quickly enough here...


in:

<a href="client-story_Detail.php?<?php echo $record['title'] . "-". $record['num']; ?>

what does the <?php echo $record['title'] . "-". $record['num']; ?> part of it do exactly??

I tried <a href="client-story_Detail.php?<?php echo $record['story_title'] ?>">Read more</a>

and i get a "record not found message...

Help! :)

(i have two 'read more' links in the following file... the one goes to the client stories detail page on the live site. just for temporary purposes until i get the other one working. ;)
Attachments:

client-stories.php 5K

Re: [gagester] One Section Editor, Multiple Viewer URL's -- Possible?

By Chris - August 31, 2009

Hi gagester,

The . is the string concatenation operator in PHP. For example: "hello" . "there" results in "hellothere".

This code:

<?php echo $record['title'] . "-". $record['num']; ?>

is the same as this code:

<?php echo $record['title'] ?>-<?php echo $record['num']; ?>

You can't omit the "-123" from a standard Detail page URL because that's how CMSb finds the record. You'll have to add the record num back into the URL, like so:

<a href="client-story_Detail.php?<?php echo $record['story_title'] . "-". $record['num'] ?>">Read more</a>

I hope this helps! Please let us know if you have any more questions or comments.
All the best,
Chris