Include a section of a webpage on other webpages

Status
Not open for further replies.

Mole

Member
I have used PHP includes, but my question is:

Is there a way of including only a section/div from one page on other pages, so when adding new content, the user will only have to add info once on the original page?

I will be adding Concrete5 CMS

For example, the website I am designing (for a GAA club) has a Lotto Results page. I want to have it so, that the latest entry on the Lotto page, will appear in a div under the navigation on all other pages on the site. Thanks.
 

php.allstar

New Member
Can you give a graphical/clearer explanation of what you're trying to achieve.
 

Mole

Member
This is the Lotto page. It will be updated weekly. Number 1 is the latest entry.



I need the latest entry from the Lotto page to appear in the navigation section of all the other pages like this image:

 

louie

New Member
And why include doesn't work for you?

you should have the right section as an include already and all you have to do is include the lotto results into this section.

the way I do things is:

header - top of the page (includes all important parts [ functions, defined, connection, and everything that needs to be loaded before any other text])

footer - bottom of the page (includes everything for cleaning up the code & tracking)

left or right section - usually the navigation bar and news, etc

then we have the centre where all the magic happens.

#############
so a template page will look like this

include("header");
include("left");
include("centre");
include("footer");

so any changes I make to any of them will automatically be reflect it on the website.
 

UTD Web

New Member
Why not pull that bit of content from the database it's driven from and add it to a div that's positioned in that location on all pages?

You could place this code in it's own include file and include it on the pages it is needed on in the position it's needed.
 

Mole

Member
Why not pull that bit of content from the database it's driven from and add it to a div that's positioned in that location on all pages?

You could place this code in it's own include file and include it on the pages it is needed on in the position it's needed.

I'm sorry, but I'm lost. I haven't much PHP experience apart from using includes.

I'm still in the early stages of building the site, I'm just looking ahead to do what I can to make the CMS as easy as possible for the user.
 

UTD Web

New Member
oh right, have you experience with other languages because once you know one it's just a matter of syntax and PHP: Hypertext Preprocessor has everything you will ever need to know in there?

Does the CMS you're using have the option to move little widgets around the design like wordpress does?

Personally with specific designs like you outlined I would often opt for a simple bespoke CMS where the user can edit little sections and be brought to an edit area where an editor like Tiny or CK editor is invoked. This keeps it very simple for the end user. On this edit page a save button would post the data for insertion into a database or an update.

[sorry had to remove code as this editor deletes variables even though the code was enclosed in php tags]
 

Mole

Member
oh right, have you experience with other languages because once you know one it's just a matter of syntax and PHP: Hypertext Preprocessor has everything you will ever need to know in there?

Does the CMS you're using have the option to move little widgets around the design like wordpress does?

Personally with specific designs like you outlined I would often opt for a simple bespoke CMS where the user can edit little sections and be brought to an edit area where an editor like Tiny or CK editor is invoked. This keeps it very simple for the end user. On this edit page a save button would post the data for insertion into a database or an update.

[sorry had to remove code as this editor deletes variables even though the code was enclosed in php tags]

Thanks for your reply. I'm using Concrete5. It is very user friendly. It does allow the user to rearrange items on the page.
 
Status
Not open for further replies.
Top