Posts: 29
Threads: 5
Joined: Mar 2012
Is there a "good" way to have content from another page beeing pulled into a page.
For example to have content from an "About Us" - section pulled into the "Home" - section of a get simple website.
I guess you could just use some PHP like simpleXML to load & parse the XML-file for that section but I just wonder if there is another way of doing it that is more related to the get simple cms.
Best, Niklas
Posts: 1,108
Threads: 70
Joined: Aug 2009
just use getPageContent('slug_name') to output content from another page
Posts: 29
Threads: 5
Joined: Mar 2012
Aha!
Thank you very much for that answer!
Niklas
Posts: 29
Threads: 5
Joined: Mar 2012
2012-05-21, 19:31:42
(This post was last modified: 2012-05-21, 19:32:18 by afpoh.)
Hmm...now I've tried this but it seems as though it doesn't work.
No matter what I do it still treat it as if the code would be <?php get_page_content(); ?>
Niklas
Posts: 1,108
Threads: 70
Joined: Aug 2009
What version of GS are you using , this function is from version 3.1 onwards.
Posts: 29
Threads: 5
Joined: Mar 2012
n00dles101 Wrote:What version of GS are you using , this function is from version 3.1 onwards.
Hi - thanks for a fast answer!
I'm using version 3.1
I have a page with a slug that is kontakt - i.e
www.mysite.com/kontakt
Then I try this <?php get_page_content('kontakt'); ?> with no result other than it outputs the content as if I would be using <?php get_page_content(); ?>
Posts: 1,108
Threads: 70
Joined: Aug 2009
Yes this is what it does.
It allows you to pull in the content areas from other pages into 1.
What exactly are you trying to do?
Posts: 29
Threads: 5
Joined: Mar 2012
Hi!
Hmmm...maybe we misunderstand each other or maybe I misunderstood the whole thing.
I'm trying to have the content for the kontakt-section or "kontakt-page" to be displayed on the start/index page. When is use <?php get_page_content('kontakt'); ?> on the indexpage it still display the content for the startpage. Am I missing something obvious here? :?
Niklas
Posts: 29
Threads: 5
Joined: Mar 2012
widecircle Wrote:Hi!
Hmmm...maybe we misunderstand each other or maybe I misunderstood the whole thing.
I'm trying to have the content for the kontakt-section or "kontakt-page" to be displayed on the start/index page. When is use <?php get_page_content('kontakt'); ?> on the indexpage it still display the content for the startpage. Am I missing something obvious here? :?
Niklas
Oh - and to clarify - the slug of what I call "kontakt-page" is kontakt..
Posts: 1,108
Threads: 70
Joined: Aug 2009
it's a different function your using.
use : getPageContent('slug_name')
The one your using is for the current page only.
Posts: 29
Threads: 5
Joined: Mar 2012
2012-05-21, 20:25:06
(This post was last modified: 2012-05-21, 20:25:33 by afpoh.)
Oh - crap!
I was missing something obvious - how embarrassing.
Thank you very much for taking some of your time to help me out...
Now it works like a charm!!
Niklas
Posts: 1,108
Threads: 70
Joined: Aug 2009
no problem...
good luck with the sitte...
Posts: 6,267
Threads: 182
Joined: Sep 2011
n00dles101 Wrote:no problem...
good luck with the sitte...
wow thats not confusing at all.
I say we replace that with an alias getContentForPage() in the future.