Read Content from other pages Topic is solved
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Read Content from other pages
Hi
its posbile to read content from other pages. for expamle I am in the home page but I want to read all the content from a other page and put in the home page.
I want to use one of the pages like global content but I want it to be easy for a user to edit as global_content its for templaces.
Before I used a module maker which allow to make a module with require fields inputs. which not support in the new cmsms.
Can some help cheers
its posbile to read content from other pages. for expamle I am in the home page but I want to read all the content from a other page and put in the home page.
I want to use one of the pages like global content but I want it to be easy for a user to edit as global_content its for templaces.
Before I used a module maker which allow to make a module with require fields inputs. which not support in the new cmsms.
Can some help cheers
Re: Read Content from other pages
Sure you can: https://docs.cmsmadesimple.org/tags/cms ... /page_attr
Also have a look at this module: http://dev.cmsmadesimple.org/projects/customgs
Also have a look at this module: http://dev.cmsmadesimple.org/projects/customgs
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: Read Content from other pages
Thank you so much. I was serching all night how do this. Yes I already installed Custom Global Settings module which its very useful
Re: Read Content from other pages
Useful too (probably what you are doing): https://docs.cmsmadesimple.org/introduc ... table-gcbs
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: Read Content from other pages
I am doing someting worng here. I am trying to get content from other pages. Can someone help please?
{page_attr key='content_en' page='contact' assign='printcontent'}
{page_attr key='title' page='contact' assign='printtitle'}
{$printtitle}
{$printcontent}
Thank you. Have a great day.
{page_attr key='content_en' page='contact' assign='printcontent'}
{page_attr key='title' page='contact' assign='printtitle'}
{$printtitle}
{$printcontent}
Thank you. Have a great day.
Re: Read Content from other pages
Two things come to my mind:
- pages you want the content from can NOT be disabled (should be active)
- Smarty scopes: https://cmscanbesimple.org/blog/smarty-scope-examples
- pages you want the content from can NOT be disabled (should be active)
- Smarty scopes: https://cmscanbesimple.org/blog/smarty-scope-examples
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: Read Content from other pages
Thank you did I looked at the page and I am more confused. The pages are Active.
I try adding scope=global still no luck.
<-- Before Header -->
{page_attr key='title' page='contact' assign='printcontent' scope=global}
{page_attr key='content_en' page='contact' assign='printcontent' scope=global}
<-- main content of the courent page -->
{$printcontent}
{$printtitle}
I might have to make a UDT to get other page content and do something like this
$data = file_get_contents('http://cmsmssite.com/otherpage);
then strip out all any html and some how get the H1 tilte and get content between a div.
if there no smary do this.
I try adding scope=global still no luck.
<-- Before Header -->
{page_attr key='title' page='contact' assign='printcontent' scope=global}
{page_attr key='content_en' page='contact' assign='printcontent' scope=global}
<-- main content of the courent page -->
{$printcontent}
{$printtitle}
I might have to make a UDT to get other page content and do something like this
$data = file_get_contents('http://cmsmssite.com/otherpage);
then strip out all any html and some how get the H1 tilte and get content between a div.
if there no smary do this.
Re: Read Content from other pages
You can't use the scope parameter on the page_attr tag
Code: Select all
{page_attr key='title' page='contact' assign='printcontent'}{$printcontent=$printcontent scope=global}
Re: Read Content from other pages
also accepted is:
Code: Select all
($printcontent={page_attr key='title' page='contact'} scope=global}
Not getting the answer you need? CMSMS support options
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: Read Content from other pages (Solved)
Thank you so much DIGI3 that works great.
Andrew
Andrew