DS and Page Templates
This is an open discussion with 3 replies, filed under General.
Search
Can someone please point me in the right direction?
Thank you in advance!
Is your datasource attached to the page? If not, the page won't receive the data.
And as you're new to symphony and it looks like you're editing the datasource-php-file manually (which you shouldn't have to) you might want to read this at first: http://www.getsymphony.com/learn/concepts/view/data-sources/
Thank you Roman, i figured it out! Glad you helped me after all, i really appreciate it!
Cheers
Create an account or sign in to comment.
Hello,
I am very new to Symphony CMS, and trying to accomplish a simple task, to create a dynamic sitemap. So far i managed to install Phill Gray's Sitemap XML extension, that generates the sitemap.xml in the root directory. Until here it's working as it should.
The next thing i'm trying to accomplish is to use the extension's query for selecting the pages to be included in the sitemap, in two frontend pages, sitemap-xml and sitemap-html. The two sitemaps are already made, but they are static, and i want to turn them into dynamic sitemaps, using the query from the extension:
$pages = Symphony::Database()->fetch("SELECT p.* FROM
sym_pages
AS p ORDER BY p.sortorder ASC"); $datasources = Symphony::Database()->fetch("SELECT * FROMsym_sitemap_xml
");$this->typeindex = explode(',', trim(pregreplace('/ /', '', Symphony::Configuration()->get('indextype', 'sitemapxml')), ','));
$this->typeglobal = explode(',', trim(pregreplace('/ /', '', Symphony::Configuration()->get('global', 'sitemap_xml')), ','));
$this->typelastmod = explode(',', trim(pregreplace('/ /', '', Symphony::Configuration()->get('lastmod', 'sitemap_xml')), ','));
$this->typechangefreq = explode(',', trim(pregreplace('/ /', '', Symphony::Configuration()->get('changefreq', 'sitemap_xml')), ','));
foreach($pages as $page) { $pagetypes = Symphony::Database()->fetchCol('type', "SELECT
type
FROMsym_pages_types
WHERE pageid = '".$page['id']."' ORDER BYtype
ASC");}
Do far, i've created a datasource, data.sitemap.php, and it contains:
Furthermode, i've created the page sitemap-html.xsl in the /workspace/pages/ directory, containing:
The problem is, that the page template receives nothing from the data source, and have no idea why.
What am i doing wrong?
I would highly appreciate, if someone could point me in the right direction.
Thanks,