Forum

Thread tagged as: Problem

Creating Master Pages

It's been a year or more since I created a new Master Page, and something must have dropped off my memory stack, because I can't remember the process apparently.

I've got an existing, working Master Page called fred.html in the /pages folder within perch

On my Mac I make a copy of this and call it fredcopy.html

I ftp this into /pages on the server. I can see it via ftp correctly placed.

I expect now to see this appear in the Listing All Master Pages list

But it's not there.

What vital step am I forgetting?

Thanks

Stefan Youngs

Stefan Youngs 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

None. Is it really called fredcopy.html ?

No, I made that up. It used it by way of illustration and to indicate the entire content of the new Master Page is identical to a currently working Master Page, so as to remove the possibility I've created the new Master page with incorrect markup

https://aircrewremembered.com/masterpageproblem.html

This shows the ftp view of the /pages folder

I also show screenshots of the List of Master Pages

I made a copy of LossTemplate.html, a working Master Page

I ftp that to the server

You can see it on the server as LossTemplateCopy.html

But it's not in my list of Master Pages. I closed down perch and logged it again but it's still not there

PERCH INFORMATION

Perch: 2.8.2 Production mode: Production (100) Installed apps: content (2.8.2), assets (2.8.2), categories (2.8.2), perch_gallery (2.8.4), perch_comments (1.0.1) DB driver: PDO DB tables: BattleofBritainRoll, BomberCommandCleaned, BomberCommandLosses, BomberCommandNew, BomberCommandOperationalLosses, BomberCommandTest, BomberCommandUpdateTest, DeutscheKreuzGoldAwards, DeutscheKreuzNew, KackerTest, KrackerArchiveAxis, KrackerDatabase, LuftwaffePilotData, PoWAlliedMaster, PolishHonourRoll_West, RAAFEuropeanLosses, RAAFLosses, RunnymedeMemorial, TopScorers, hesk_attachments, hesk_categories, hesk_kb_articles, hesk_kb_attachments, hesk_kb_categories, hesk_logins, hesk_mail, hesk_notes, hesk_online, hesk_pipe_loops, hesk_replies, hesk_std_replies, hesk_tickets, hesk_users, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_gallery_albums, perch2_gallery_image_versions, perch2_gallery_images, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users Users: 9 App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_comments/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_gallery/runtime.php'); ?> Editor plug-ins: redactor, tinymce, markitup, ckeditor H1: 6d2e5c503f10ab8cdb8d8d5cfe9da389 L1: 30e62d05c451dbc35ba141aa8669341b headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 1 content_collapseList: 1 lang: en-gb latest_version: 2.7.10 headerScheme: light dashboard: 0 content_hideNonEditableRegions: 0 logoPath: /editorial/resources/1356354991_arbanner235Perch.png on_sale_version: 2.8.2 update_2.4.2: done content_frontend_edit: 1 update_2.4.3: done update_2.4.4: done update_2.4.5: done update_2.4.9: done perch_gallery_update: 2.8.4 update_2.5.1: done update_2.5.2: done update_2.5.3: done update_2.5.4: done update_2.6: done update_2.6.3: done update_2.6.5: done update_2.6.6: done update_2.7.2: done update_2.7.10: done update_2.8.2: done PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: kelstef_arem PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: kelstef_arem PERCH_DB_PREFIX: perch2_ PERCH_EMAIL_FROM: oriorda@me.com PERCH_EMAIL_FROM_NAME: Stefan Youngs PERCH_LOGINPATH: /editorial PERCH_PATH: /home4/kelstef/public_html/editorial PERCH_CORE: /home4/kelstef/public_html/editorial/core PERCH_RESFILEPATH: /home4/kelstef/public_html/editorial/resources PERCH_RESPATH: /editorial/resources PERCH_HTML5: 1 PERCH_CLEAN_RESOURCES: PERCH_RUNWAY: PERCH_ERROR_MODE: DIE PERCH_DATE_LONG: %d %B %Y PERCH_DATE_SHORT: %d %b %Y PERCH_TIME_SHORT: %H:%M PERCH_TIME_LONG: %H:%M:%S PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home4/kelstef/public_html/editorial/templates PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_RWD: PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: HOSTING SETTINGS

PHP: 5.4.38 Zend: 2.4.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: 5.5.40-36.1 MySQL server: 5.5.40-36.1 Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, intl, json, mbstring, mcrypt, mssql, mysql, mysqli, odbc, standard, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, imagick, SourceGuardian, mhash, ionCube Loader, Zend Guard Loader GD: Yes ImageMagick: Yes PHP max upload size: 64M PHP max form post size: 64M PHP memory limit: 256M Total max uploadable file size: 64M Resource folder writeable: Yes Session timeout: 24 minutes Native JSON: Yes Filter functions: Yes Transliteration functions: Yes DOCUMENT_ROOT: /home4/kelstef/public_html GATEWAY_INTERFACE: CGI/1.1 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_ACCEPT_LANGUAGE: en-us HTTP_CONNECTION: close HTTP_COOKIE: __unam=7639673-1497afb6b28-6063fd13-1413; __utma=109100309.1852979748.1415107534.1424778748.1425332764.101; __utmz=109100309.1423846541.85.3.utmcsr=bing|utmccn=(organic)|utmcmd=organic|utmctr=hore-kennard; _ga=GA1.2.1852979748.1415107534; _hp2_id.3226262449=6659994950585736.3534461790.0902155585; _hp2_ses.3226262449=*; cmsa=1; PHPSESSID=a59ecf9170b1ef69454ece74a9e167bf HTTP_DNT: 1 HTTP_HOST: aircrewremembered.com HTTP_REFERER: https://aircrewremembered.com/editorial/core/settings/diagnostics/ HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18 HTTP_X_HTTP_PROTO: HTTP/1.1 HTTP_X_LOG_7528: 109.224.169.216 HTTP_X_REAL_IP: 109.224.169.216 PATH: /bin:/usr/bin PHPRC: /opt/php54/lib QUERY_STRING: extended REDIRECT_STATUS: 200 REMOTE_ADDR: 109.224.169.216 REMOTE_PORT: 43117 REQUEST_METHOD: GET REQUEST_URI: /editorial/core/settings/diagnostics/?extended SCRIPT_FILENAME: /home4/kelstef/public_html/editorial/core/settings/diagnostics/index.php SCRIPT_NAME: /editorial/core/settings/diagnostics/index.php SERVER_ADDR: 192.254.224.43 SERVER_ADMIN: webmaster@aircrewremembered.com SERVER_NAME: aircrewremembered.com SERVER_PORT: 80 SERVER_PROTOCOL: HTTP/1.1 SERVER_SIGNATURE: <address>Apache Server at aircrewremembered.com Port 80</address> SERVER_SOFTWARE: Apache UNIQUE_ID: VQbqFzJXkIEAAC82@s0AAARU PHP_SELF: /editorial/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1426516503.51 REQUEST_TIME: 1426516503 argc: 1

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does debug output for the master page listing?

Sorry Drew, but I don't how to access debugging.. I read the documentation but can't figure what i have to do

Rachel Andrew

Rachel Andrew 394 points
Perch Support

You just need to add the constant to your config for admin debug output.

https://solutions.grabaperch.com/development/how-do-i-debug-problems

Thank you Rachel. This useful page on how to add the debugger did not show up when I Searched on debug in Documentation.

This is the debug report from the List of Master Pages

Debug Message
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='fe82ae59adba7ae2398d4aa302fa8351' LIMIT 1
UPDATE perch2_users SET userHash='dca33fd65e4e89380b0239119313b501' WHERE userID=1
SELECT p.privKey FROM perch2_user_privileges p
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
SELECT *, (LENGTH(templatePath) - LENGTH(REPLACE (templatePath, "/", ""))) AS depth FROM perch2_page_templates ORDER BY depth, templatePath ASC
SELECT *, (LENGTH(templatePath) - LENGTH(REPLACE (templatePath, "/", ""))) AS depth FROM perch2_page_templates ORDER BY depth, templatePath ASC
Queries: 7
Memory: 2.3647

This is the bug report from a working Master page

Debug Message
SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='b004ab795821395bff74eb76db209808' LIMIT 1
UPDATE perch2_users SET userHash='5c84472737405916ecc834eb5f0c1ad3' WHERE userID=1
SELECT p.privKey FROM perch2_user_privileges p
SELECT * FROM (SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID
SELECT * FROM perch2_page_templates WHERE templateID=14 LIMIT 1
SELECT * FROM perch2_navigation ORDER BY groupTitle ASC
SELECT p.*, (SELECT COUNT(*) FROM perch2_pages WHERE pageParentID=p.pageID) AS subpages FROM perch2_pages p ORDER BY pageTreePosition ASC
Queries: 8
Memory: 14.1019
Drew McLellan

Drew McLellan 2638 points
Perch Support

That all looks fine. Is it jus this one master page that isn't showing up?

No. If you look at

https://aircrewremembered.com/masterpageproblem.html

you can see several Master Pages on the server that are not in the List of Master Pages

I just made another one and it too, doesn't show up.

Obviously I have been able to add Master Pages in the past, but exactly at what point this process stopped working for me I can't say.

Thanks for your attention to this.

I would add I am not experiencing problems creating new content pages. Our editors are happily banging away.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do the master pages show up on your dev site?

I see what you're thinking, but we don't have a dev site.

We bravely go where no man has gone before.. direct to live.

I looked at our htaccess file to see if there was anything there that might be inhibiting the process, but we just have caching, analytics integration, and we stop a browser looking at the htaccess file. This file hasn't changed in over a year, way before this Master Page problem arose.

The last Master page I loaded up and can use was in September 2014, incidentally.

I don't know if this helps, but here is the error log from the pages folder

[27-Feb-2014 16:04:21] PHP Warning: include(editorial/runtime.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home4/kelstef/public_html/editorial/templates/pages/HomepageTemplateTest.html on line 1 [27-Feb-2014 16:04:21] PHP Warning: include(editorial/runtime.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home4/kelstef/public_html/editorial/templates/pages/HomepageTemplateTest.html on line 1 [27-Feb-2014 16:04:21] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'editorial/runtime.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home4/kelstef/public_html/editorial/templates/pages/HomepageTemplateTest.html on line 1 [27-Feb-2014 16:04:21] PHP Fatal error: Call to undefined function perch_pages_title() in /home4/kelstef/public_html/editorial/templates/pages/HomepageTemplateTest.html on line 10

Rachel Andrew

Rachel Andrew 394 points
Perch Support

How do you test changes if you don't have a development site?

I would suggest you get a development version of your site up and running so you can debug your issue properly. It's going to be very difficult for us to help in the knowledge that we are asking you to make changes to your live copy.

I'm in the process of getting a copy of my site locally now. I haven't been concerned about making changes to my live site as I have daily copies of all my MySQL databases, but I agree it would be better to have a mirror copy somewhere else just in case.

I've still got this issue where I correctly create a new Master Page, ftp it to the correct location and when I try to use it, it doesn't show up in Master Pages.

If I modify an existing Master Page, ftp that to the correct location, then the changed Master Page takes effect, so it doesn't seem to be an issue of putting a new Master Page in the wrong place - I am getting this bit right.

If I simply copy an existing Master Page and name it something different, then ftp that, it doesn't appear in Master Pages so it can't be an issue of a malformed Master Page

If I delete an unused Master Page and ftp a new one, the new one doesn't appear in Master Pages, so it's not an issue of having too many Master Pages (we have about 20)

What more can I tell you so you can help me overcome this problem? I certainly need to add more Master Pages as the scope of our site grows.

Thanks

Rachel Andrew

Rachel Andrew 394 points
Perch Support

We need to see your code for these pages.

Thanks for sticking with me.

This page

https://aircrewremembered.com/magicofflighttest.html

was created with the following Master Page

I can freely change this Master Page and see the the effect on the published page. In other words I can ftp the changed page and see the changes take place.

If I simply rename this page and make it into a new Master page, then this new page will not appear in my Master Pages list. I can see the new page on the server.

I have previously been able to create and make active new Master Pages and I don't know at which upgrade point it stopped working.

<?php include('editorial/runtime.php'); ?>


<!DOCTYPE html>

<html lang="en">


<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title><?php perch_pages_title(); ?></title>

    <meta charset='utf-8'/>
<link rel="stylesheet" type="text/css" media="screen" href="../ARCSS/trebuchet.css"/>

<link href="../ARCSS/jquery.tweet.css" media="all" rel="stylesheet" type="text/css"/>

<!-- Share This -->
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="https://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "2e13524e-c851-458b-b6a1-9c0a4062c508"});</script>

<!-- end ShareThis -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script language="javascript" src="../JavaScriptFolder/jquery.tweet.js" type="text/javascript"></script>

<script language="javascript" src="../JavaScriptFolder/JQuerytweet.js" type="text/javascript">
</script>

<!-- <style>
a.rollover img {
    width: 100%;
    height: 100%;
}

a.rollover:hover > img {
    width: 200%;
    height: 200%;
    -moz-animation: emotion 2s; /* Firefox */
    -o-animation: emotion 2s; // For Opera
    -ms-animation: emotion 2s; // For Explorer 9
    -webkit-animation: emotion 2s; // Chrome and Safari
    -moz-animation: emotion 2s; // Firefox
    -khtml-animation: emotion 2s; //  Konqueror
    -animation: emotion 2s; // When will the standard CSS3??
    }
@-moz-keyframes emotion
{
from {width: 100%;height:100%;}
to {width:200%;height:200%;}
}
</style> -->

<!-- <style>
:active #zoomer img {
    -moz-transform: scale(2);
    -ms-transform: scale(2);
    -o-transform: scale(2);
    -webkit-transform: scale(2);
    transform: scale(2);
     overflow:hidden;
}

</style> -->


<!-- Share This -->
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="https://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "2e13524e-c851-458b-b6a1-9c0a4062c508"});</script>

<!-- end ShareThis -->

 <script type="text/javascript" src="JAVASCRIPT/addEvent.js"></script>
 <script type="text/javascript" src="JAVASCRIPT/sweetTitles.js"></script>

 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="../JavaScriptFolder/jquery.magnifier.js">

</script>

 <meta name="google-translate-customization" content="b7e15d24ce5b4782-d03be234f425209f-g63701f1a25b869c8-19"></meta>

  <!-- inserts Description and Keywords in pages -->
 <?php
perch_page_attributes(array(
  'template' => 'seo.html'
));
?>
 <!-- ends inserts Description and Keywords in pages -->

</head>

<body style="width:1000px;height:1400px; margin-left:auto; margin-right:auto;">
<div class="wrapper" onclick="">
<div style="width:1000px;height:30px;margin-left:auto; margin-right:auto;  margin-top:20px;background-color:#;border:0px solid #aeb4ba;border-radius:10px;">



<div style="width:100%;position:relative;z-index:10;">


</div>
</div>

<div style="height:150px;margin-top:0px; ">
<img src="../ARSiteImages/arbanner600transparentNoTag.png">
<div style="margin-left:740px;margin-top:-80px;border:0px white;">
<span style="font-size:9px;"><br />
</span>


</div>
<div onclick="void(0)"> <!--iOS clear dropdown -->



<div style="margin-top:30px;width:80%;border:1px solid #e7e9f2;border-radius:10px;background-color:#f9fafc;padding:20px;margin-left:auto;margin-right:auto;">

<div style="margin-left:590px; margin-top:-50px; width:200px;height:200px;border:0px solid black;">

<?php perch_content('Picture'); ?>

</div>

 <div style="margin-top:-170px;border:0px solid black;width:600px;padding:20px;font-size:18px;font-weight:700;margin-left:auto;margin-right:auto;text-align:center;">

<?php perch_content('Headline'); ?>
</div>

 <div style="font-size:24px;font-weight:500;">
<?php perch_content('StoryTinyMCE'); ?>
</div>
</div>
</div>
<div style="width:100%;text-align:center; margin-top:20px;font-size:10px;underline:no-underline;">

<p>At the going down of the sun, and in the morning we will remember them. - <span style="font-style:italic;">Laurence Binyon</span></p>


</div>
</div>

<div style="margin-top:-500px;width:15%;position:relative;z-index:100;position:absolute;">

</div>
</div>



<?php perch_get_javascript(); ?>
</body>
</html>
Drew McLellan

Drew McLellan 2638 points
Perch Support

How many items do you have in your templates/pages folder?

38 at present... 22 of them are active

I've been in the habit of developing an experimental Master Page, trying it out on editors, making a change and putting a new version up and getting them to compare. I haven't then gone back and deleted the trials as I've never been sure we wouldn't want to revert to one of them in the future.

As our site is growing in its breadth on a regular basis, with each new idea requiring a different Master Page, I can see our active Masters getting to 30 active this year.

Thanks again... I admire the hours you put into this project... you're giving support and it's 11PM.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That seems like an odd number for it to stop at. I'll see if I can dig anything up.

Wondering if you got any further with this. I'm really stuck with not being able to add more Master Pages.

Thanks