5 Quickie "How to" Questions!

8 posts by 3 authors in: Forums > CMS Builder
Last Post: January 26, 2008   (RSS)

By Perchpole - January 25, 2008

Hello, All -

I'm currently enjoying my CMS Builder 10-day free trial and I must say I'm very impressed! I've been a big fan of AM and other interactivetools products for some time and this latest addition to the line-up is up there with the best.

Over the years I've spent many a long evening tinkering with AM template designs. I'm now trying to do the same with CMS Builder. Although (generally) I'm very happy with what I can do there are a couple of fairly simple things that seem to be beyond me! Could someone please explain how I can (use PHP to) do the following:

1) How do I "call" the section name to use as a page <Title> (on both list and viewer pages)?

2) How do I call a record field to use as a page <Title> (on viewer pages)?

3) How would I create a link to take people from a viewer page back to the parent list page?

4) How can I create (forward and back) links to allow people to step - sequentially - from (viewer) page to page?

5) How can I create a list page which list the latest documents from multiple sections?

I probably should add that although I've done a lot of work with AM template creation I have fairly limited experience with (serious) PHP coding. So, apologies in advance if any of the above seem a bit simplistic! I apreciate I can do many of these manually. However, as I have automated many of these functions within AM templates, I am keen to see if I can do the same with CMS Builder.

Thanks

[:)]

AJ

Re: [Dave] 5 Quickie "How to" Questions!

By Kenny - January 25, 2008

On # 3 - just simply insert the following code to link back to your list page:

<FORM>
<INPUT TYPE="button" VALUE="Get Back, Jack!" onClick="history.go(-1)">
</FORM>

Re: [sagentic] 5 Quickie "How to" Questions!

By Perchpole - January 25, 2008

Hello Chaps -

Thanks for your help and advice. I had already considered the bulk of your suggestions which is why I was keen to develop a more inventive solution. I'd rather not hardcode things like page titles if I can avoid it. I've become accustomed to playing around with AM templates and placeholders to the point where I can just drop a template on to the system and it will pretty much fill in all of the blanks automatically. I was rather hoping CMS Builder would allow me to do the same.

[unimpressed]

AJ

Re: [Perchpole] 5 Quickie "How to" Questions!

By Dave - January 25, 2008

It can, and I can give you code for that if you like, I was just starting with the simplest solution. Let me know which ones you want to load and we can figure out the code for it.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] 5 Quickie "How to" Questions!

By Dave - January 26, 2008

Further on that. Here's how to load the section title. You need to put this code before the "Step1" block that defines the tablename and loads the library file.

<?php
$schema = loadSchema($options['tableName']);
print $schema['menuName'];
?>


Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] 5 Quickie "How to" Questions!

By Perchpole - January 26, 2008

Hi, Dave -



Thanks for the code. This is exactly the type of "snippet" that I like! Contrary to your instructions, however, it only seems to work if placed below Step1.

Otherwise it's great! Thanks.

[:)]

AJ

PS. Any more of these snippets would be most welcome.

Re: [Perchpole] 5 Quickie "How to" Questions!

By Dave - January 26, 2008

That's right, when I say "before" what I mean by that is "below". hehe. Glad you caught that!

>PS. Any more of these snippets would be most welcome.

Just about anything you might want to do is possible. So if you have a specific challenge we can work with that.

Auto linking back and forth between viewers is a little tricky because you can create unlimited viewers and there's no way to tell which is which. When you're on the job page for example you wouldn't want to link back to the viewer that shows the "Top 3 featured jobs" on the home page.

One way to do it would be to use a naming convention where you had jobsList.php and jobsPage.php or /subdir/index.php (which you could call as just /subdir/) and /subdir/detail.php. It you had a set naming convention it would be easy to have a little code that figured out one name from the other.

Another cool thing you can do is define your own section "presets". Once you've created a section, if you copy the file for it from /data/schema/ to /data/schemaPresets/ it will show up in the section add list.

Hope that helps! :)
Dave Edis - Senior Developer
interactivetools.com