We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Runway

Template includes

I've just upgrade a site to Perch 3 (Runway) and I think it has stopped template includes being referenced…

I have a template that includes an svg, for example:

<perch:template path="layouts/svg/transform.svg" />

and it works ok if I replace that with the svg code itself, but when it's an included file it's not appearing on the page. I've tried it with a few different file formats (.txt, .html, .php) in case it was .svg that it wasn't enjoying, but no joy. It was working fine until the upgrade, if that's any help.

Here are my diagnostics:

Summary information

Perch Runway: 3.0.2, PHP: 7.0.13, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (3.0.2), assets (3.0.2), categories (3.0.2), perch_blog (5.5.1), perch_forms (1.9)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', ];
PERCH_LOGINPATH: /cms
PERCH_PATH: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms
PERCH_CORE: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/core
PERCH_RESFILEPATH: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: gospelware.local
DOCUMENT_ROOT: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Martin Underhill

Martin Underhill 5 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug have to say about it?

Time    Δ   Debug Message - Perch Runway 3.0.2
0.0467  0   [25] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch2_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch2_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
0.0534  0.0068  Matched page: /, so not using routes.
0.0536  0.0002  Using master page: /templates/pages/home.php
0.0607  0.0071  [1] SELECT * FROM perch2_pages WHERE pagePath='/' LIMIT 1
0.0634  0.0027  Using template: /templates/pages/attributes/default.html
0.0765  0.0131  Using sub-template: /templates/pages/attributes/seo.html
0.0811  0.0046  Using sub-template: /templates/pages/attributes/open_graph.html
0.0816  0.0005  Using sub-template: /templates/pages/attributes/twitter.html
0.0819  0.0004  Using sub-template: /templates/pages/attributes/google_sitename.html
0.0869  0.0049  [6] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
0.088   0.0011  [1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
0.0885  0.0006  [1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000') ORDER BY pageTreePosition DESC
0.0903  0.0018  [10] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/' OR regionPage='*' ORDER BY regionPage DESC
0.0933  0.003   [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Heading' AND (regionPage='/' OR regionPage='*')
0.0943  0.001   [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=82 AND idx.itemRev=23)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1008  0.0066  [1] Using template: /templates/content/heading.html
0.1032  0.0023  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Services teaser' AND (regionPage='/' OR regionPage='*')
0.104   0.0009  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=61 AND idx.itemRev=11)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1169  0.0128  [1] Using template: /templates/content/homepage_teaser.html
0.1174  0.0005  Using sub-template: /templates/content/heading.html
0.1175  0.0001  Using sub-template: /templates/content/introduction.html
0.1198  0.0023  [1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Services'
0.1209  0.0011  [3] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE (idx.collectionID=2) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
0.1546  0.0337  Using template: /templates/content/service_list_short.html
0.1549  0.0002  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1549  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.155   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.155   0   [3] Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1555  0.0005  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1556  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1557  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.1557  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1559  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1559  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1559  0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.156   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1574  0.0014  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1575  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1575  0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.1576  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1588  0.0012  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1589  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.159   0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.159   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1609  0.0019  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Work teaser' AND (regionPage='/' OR regionPage='*')
0.1633  0.0023  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=60 AND idx.itemRev=23)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1787  0.0154  [1] Using template: /templates/content/homepage_teaser.html
0.179   0.0003  Using sub-template: /templates/content/heading.html
0.1791  0.0001  Using sub-template: /templates/content/introduction.html
0.1869  0.0078  [1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Work'
0.1881  0.0012  [3] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='title' WHERE (idx.collectionID=1) AND ((idx.indexKey='slug' AND idx.indexValue != '') OR (idx.indexKey='status' AND idx.indexValue='published')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval HAVING count(*)=2 ORDER BY RAND() LIMIT 0, 3
0.223   0.0349  Using template: /templates/content/projects.html
0.2233  0.0003  [3] Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2239  0.0006  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.224   0.0002  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2249  0.0009  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2258  0.0009  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2282  0.0024  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='About teaser' AND (regionPage='/' OR regionPage='*')
0.2339  0.0057  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=72 AND idx.itemRev=8)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.274   0.0401  [1] Using template: /templates/content/homepage_teaser.html
0.2746  0.0006  Using sub-template: /templates/content/heading.html
0.2749  0.0003  Using sub-template: /templates/content/introduction.html
0.3035  0.0286  
Array
(
    [type] => 8
    [message] => Use of undefined constant RAND - assumed 'RAND'
    [file] => /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/pages/home.php
    [line] => 34
)
What we do.  Work and vision.  Who we are.  Careers.  News and views. Get in touch.


© 2017 Gospelware™ Made with love in Newcastle upon Tyne. Gospelware™ is a registered trademark. Company no: 07329554.
Privacy policy
Time    Δ   Debug Message - Perch Runway 3.0.2
0.0467  0   [25] SELECT p.pagePath, pr.routePattern, pr.routeRegExp, p.pageTemplate, pr.routeOrder, s.settingValue AS siteOffline FROM perch2_pages p LEFT JOIN perch2_page_routes pr ON p.pageID=pr.pageID LEFT JOIN perch2_settings s ON s.settingID='siteOffline' UNION SELECT NULL AS pagePath, pr2.routePattern, pr2.routeRegExp, pr2.templatePath AS pageTemplate, pr2.routeOrder, NULL AS siteOffline FROM perch2_page_routes pr2 WHERE templateID!=0 ORDER BY routeOrder ASC, pagePath ASC
0.0534  0.0068  Matched page: /, so not using routes.
0.0536  0.0002  Using master page: /templates/pages/home.php
0.0607  0.0071  [1] SELECT * FROM perch2_pages WHERE pagePath='/' LIMIT 1
0.0634  0.0027  Using template: /templates/pages/attributes/default.html
0.0765  0.0131  Using sub-template: /templates/pages/attributes/seo.html
0.0811  0.0046  Using sub-template: /templates/pages/attributes/open_graph.html
0.0816  0.0005  Using sub-template: /templates/pages/attributes/twitter.html
0.0819  0.0004  Using sub-template: /templates/pages/attributes/google_sitename.html
0.0869  0.0049  [6] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 ORDER BY pageTreePosition ASC
0.088   0.0011  [1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
0.0885  0.0006  [1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000') ORDER BY pageTreePosition DESC
0.0903  0.0018  [10] SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/' OR regionPage='*' ORDER BY regionPage DESC
0.0933  0.003   [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Heading' AND (regionPage='/' OR regionPage='*')
0.0943  0.001   [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=82 AND idx.itemRev=23)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1008  0.0066  [1] Using template: /templates/content/heading.html
0.1032  0.0023  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Services teaser' AND (regionPage='/' OR regionPage='*')
0.104   0.0009  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=61 AND idx.itemRev=11)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1169  0.0128  [1] Using template: /templates/content/homepage_teaser.html
0.1174  0.0005  Using sub-template: /templates/content/heading.html
0.1175  0.0001  Using sub-template: /templates/content/introduction.html
0.1198  0.0023  [1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Services'
0.1209  0.0011  [3] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE (idx.collectionID=2) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval ORDER BY sortval ASC
0.1546  0.0337  Using template: /templates/content/service_list_short.html
0.1549  0.0002  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1549  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.155   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.155   0   [3] Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1555  0.0005  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1556  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1557  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.1557  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1559  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1559  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1559  0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.156   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1574  0.0014  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1575  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.1575  0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.1576  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1588  0.0012  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/concept.svg.html
0.1589  0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html
0.159   0.0001  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/transform.svg.html
0.159   0   Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.1609  0.0019  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='Work teaser' AND (regionPage='/' OR regionPage='*')
0.1633  0.0023  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=60 AND idx.itemRev=23)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.1787  0.0154  [1] Using template: /templates/content/homepage_teaser.html
0.179   0.0003  Using sub-template: /templates/content/heading.html
0.1791  0.0001  Using sub-template: /templates/content/introduction.html
0.1869  0.0078  [1] SELECT collectionID, collectionTemplate FROM perch2_collections WHERE collectionKey='Work'
0.1881  0.0012  [3] SELECT * FROM ( SELECT idx.itemID, ci.collectionID, ci.itemJSON, idx2.indexValue as sortval FROM perch2_collection_index idx JOIN perch2_collection_items ci ON idx.itemID=ci.itemID AND idx.itemRev=ci.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_revisions cr ON idx.itemID=cr.itemID AND idx.itemRev=cr.itemRev AND idx.collectionID=ci.collectionID JOIN perch2_collection_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='title' WHERE (idx.collectionID=1) AND ((idx.indexKey='slug' AND idx.indexValue != '') OR (idx.indexKey='status' AND idx.indexValue='published')) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, itemJSON, sortval HAVING count(*)=2 ORDER BY RAND() LIMIT 0, 3
0.223   0.0349  Using template: /templates/content/projects.html
0.2233  0.0003  [3] Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2239  0.0006  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.224   0.0002  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2249  0.0009  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2258  0.0009  Requested sub-template not found: /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/icon--chevron-right.svg.html
0.2282  0.0024  [1] SELECT regionID, regionTemplate, regionPage, regionRev AS rev FROM perch2_content_regions WHERE regionKey='About teaser' AND (regionPage='/' OR regionPage='*')
0.2339  0.0057  [1] SELECT * FROM ( SELECT idx.itemID, c.regionID, idx.pageID, c.itemJSON, idx2.indexValue as sortval FROM perch2_content_index idx JOIN perch2_content_items c ON idx.itemID=c.itemID AND idx.itemRev=c.itemRev AND idx.regionID=c.regionID JOIN perch2_content_index idx2 ON idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev AND idx2.indexKey='_order' WHERE ((idx.regionID=72 AND idx.itemRev=8)) AND idx.itemID=idx2.itemID AND idx.itemRev=idx2.itemRev ) as tbl GROUP BY itemID, pageID, itemJSON, sortval, regionID ORDER BY sortval ASC
0.274   0.0401  [1] Using template: /templates/content/homepage_teaser.html
0.2746  0.0006  Using sub-template: /templates/content/heading.html
0.2749  0.0003  Using sub-template: /templates/content/introduction.html
0.3035  0.0286  
Array
(
    [type] => 8
    [message] => Use of undefined constant RAND - assumed 'RAND'
    [file] => /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/pages/home.php
    [line] => 34
)
0.3208  0.0172  [6] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=2 ORDER BY pageTreePosition ASC
0.3221  0.0013  [1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/' LIMIT 1
0.324   0.0019  [1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-001', '000') ORDER BY pageTreePosition DESC
0.3249  0.0009  [6] Using template: /templates/navigation/item.html
0.3325  0.0076  [1] SELECT groupID FROM perch2_navigation WHERE groupSlug='footer-nav' LIMIT 1
0.3362  0.0038  [1] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch2_navigation_pages np, perch2_pages p WHERE p.pageID=np.pageID AND np.groupID=2 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=2 ORDER BY np.pageTreePosition ASC
0.3384  0.0021  [0] SELECT np.pageTreePosition FROM perch2_pages p, perch2_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=2 AND p.pagePath='/' LIMIT 1
0.3396  0.0012  [1] Using template: /templates/navigation/item.html
0.3419  0.0023  [27] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
0.3461  0.0041  Request time: 0.346
0.3462  0.0001  Process time: 0.3427
0.3574  0.0113  Memory: 2.9284
0.3575  0.0001  
Array
(
    [type] => 8
    [message] => Use of undefined constant RAND - assumed 'RAND'
    [file] => /Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/pages/home.php
    [line] => 34
)

Hope that helps…

Drew McLellan

Drew McLellan 2638 points
Perch Support

/Users/TemperTemper/Sites/Gospelware/gospelware.co.uk/web/cms/templates/content/layouts/svg/create.svg.html

Does it help?

Is it automatically adding an .html extension? It used to be ok with svg, didn't it? Or was that a bug that has been fixed in v3? If so I've got a lot of refactoring to do before I upgrade any more sites to v3…

Drew McLellan

Drew McLellan 2638 points
Perch Support

Templates are .html files, so I'm not quite sure what you're doing.

It looks like two things, according to that file path from the debug:

  1. it's using perch/templates/content/ as the root directory for perch:template
  2. it's automatically adding a .html file extension

Up until upgrading I had been referencing .svg files using perch:template and it worked ok.

I was using perch/templates/ as the root too, so I was able to reference SVG files in the perch/templates/layouts/ directory too (I was referencing these in both layouts/pages and in content templates), meaning I only had to have one SVG file that could be referenced from anywhere. Actually the docs say:

The path is relative to the perch/templates directory

so that might be a bug.

On the file extension front, I guess that must've been me inadvertently taking advantage of a bug that was fixed in version 3.

Is there any chance you could officially allow .svg files to be referenced in a perch:template tag (SVG being a sort of subset of HTML anyway)…?

Actually, thinking about allowed filetypes, it would be super cool to allow .txt files and maybe even .md file too… (I mentioned .php in my initial question – that was an oversight because of course .php wouldn't render in a template… Sorry if that was misleading!)

If it has to be .html, let me know and I'll go through all my sites and change all of the .svg files a .html extension instead.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you want to include PHP you can use a layout tag for that.

perch:template tags are intended for including sub templates. If you're relying on some undefined behaviour that has now changed, I'm not sure that's entirely my fault.

I'll see if we have find a way to accommodate that sort of use without breaking the defined behaviour for everyone else.

Yeah, sorry about mentioning the php thing. Just confused things.

Certainly no blame thrown on the change in behaviour – I think I was exploiting a bug and thinking it was normal behaviour :) Not your fault at all that it's doing only the thing it was intended to do now :D But thanks for having a look to see whether you can accommodate it – it'd save me a lot of work, so fingers crossed you can manage it without breaking anything for everyone else.

The template path thing might be an issue though – if people have followed the docs and included /content/ in their defined file path it'll be going to perch/templates/content/content/blah and probably not finding the file. That's why my filepath was going to perch/templates/content/layouts/ – I had defined /layouts/ in my perch:template tag's fiepath: <perch:template path="layouts/svg/transform.svg" />

Hi Drew,

I've just come to update another website before doing some dev and it looks like both of the issues tied to this thread are still alive. The file path is still going to perch/templates/content/ rather than in perch/templates/, as the documentation outlines.

My debug is telling me:

Requested sub-template not found: /Users/TemperTemper/Sites/voiceintheroom.com/web/cms/templates/content/layouts/svg/twitter.svg.html

Where it should be going to

/Users/TemperTemper/Sites/voiceintheroom.com/web/cms/templates/layouts/svg/twitter.svg.html

Sorry to be a bit of a broken record on this one, but I'm chomping at the bit to upgrade my clients' sites to v3… I had to roll that website from last month back to 2.8.34 and I haven't updated any other client websites to v3 yet because of the filepath thing :'(

Also really hoping that you're able to get .svg extensions working inside templates, svg being basically html… Can't tell you how much work that would save me. You'll be able to see what I mean from the line from the debug above – it's appending .html to the filepath automatically, by the looks of it. In case it helps, I tried removing the file extension from the include completely <perch:template path="layouts/svg/twitter" /> and it added .html, and I added .html to the include <perch:template path="layouts/svg/twitter.html" /> and it didn't add it twice.

Thanks for taking a look,

Martin.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's logged, so we should get to it before long.

Great stuff. I'll work around with this site and keep an eye on the release notes. Thanks Drew :)