Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 03:23:55 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: embeding page copier into template  (Read 601 times)
Availor

Offline Offline

Posts: 225



« on: May 17, 2008, 08:20:13 PM »

Hello,

I find the module page copier very useful in many ways.

Is it possible to get a certein code snippet I can just insert into a template I'm making, so that I won't be needing declaring on each page where I want to copy the content.

For example, instead of page_content(num);  I could use something like (pasted from page copier module)
Code:
$database->query("INSERT INTO ".TABLE_PREFIX."mod_page_copier (page_id,section_id) VALUES ('$page_id','$section_id')");
But instead of "section_id" there would be a default page, like "copier".

In other words I want to embed a piece of code into my template that will copy code from a page named "test" so each time I create a new page I won't be needing to worry about adding section it will do the work automatically. In such way I can create manual menus from images that will be shown on every page, but it's a bit unconvenient copying content if I have a 100 pages website   cheesy Hope that someone can help me out with this.

Thanks.
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #1 on: May 17, 2008, 08:34:11 PM »

A couple of weeks ago I answered a question that might work for you too.

A few lines of PHP code that adds one section (ie. on a hidden page) to your template.

Read this: http://www.websitebaker2.org/forum/index.php/topic,9564.msg56418.html#msg56418

Ruud
Logged

Professional WebsiteBaker Solutions
Availor

Offline Offline

Posts: 225



« Reply #2 on: May 17, 2008, 08:54:16 PM »

That's exactly what I needed! Thanks a lot. As I get it the pages id are ascending by number, meaning the second page I create will get id 2.
Logged
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #3 on: May 17, 2008, 09:00:38 PM »

Just hover your mouse over the links in the backend. The url will show the pageid and sectionid.

The pageid is incremental. Removing pages will make that pageid will never be used anymore. 
You can end up with two pages with id 281 and 302  cool
So don't assume the pagenumber is the # line in the admin pages.

Anyway, just try it out, it isn't that hard.

Ruud
Logged

Professional WebsiteBaker Solutions
Availor

Offline Offline

Posts: 225



« Reply #4 on: May 17, 2008, 10:21:04 PM »

It works perfectly fine, except that the page id should also be considered the section.
It's quite confusing at start; You should hover your mouse on the section inside the page as well and that'll be the correct id in case you are using multiple sections.

I've attached a screenshot.


In this case the id would be 224 and not 51, which is the page id.
If I insert 51 it will take some other section on a different page.
« Last Edit: May 17, 2008, 10:22:40 PM by Availor » Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!