Creating Templates - Post ID 240616

User 458539 Photo


Registered User
1,206 posts
Online Now

Hello forum -

I'm using RLM and CC's Editor. Have a large site (150 pages) and there is info on the pages that might change periodically - store hours etc. I have never made a template in CC's software packages (used to use Dreamweaver and that was pretty easy) and wondered how to do it. Or if a template isn't applicable how can I make certain elements change globally? Just would like to be able to make certain element changes simple.

Hope I'm making sense

I can't stand Wordpress - anybody have another solution? Really like RLM and love the customizing ability but I have gotten this request before.

Thanks

Byron
User 2484360 Photo


Registered User
3,293 posts

You can use the Find and Replace feature in the HTML Editor to make those minor changes.
User 458539 Photo


Registered User
1,206 posts
Online Now

Can you do that globally or just one page at a time?

Thanks - good idea, that had slipped my mind

Byron
User 38401 Photo


Senior Advisor
10,951 posts

Not sure what types of changes you are talking about, but another thing to keep in mind is that if you're wanting to say change the colors or sizes of a certain thing that are on a lot or all of your pages, when you alter anything in RLM that has the same Class and/or ID names, it will automatically alter all pages of the site that contain those classes or ID names. This might be helpful if you're changing minor things like color schemes or Logos.

You'll still need to check over the pages to make sure the changes (especially if you changed any sizes of things) don't affect other areas of the page, but it is still a pretty quick way to make simple global changes. :)
User 2088758 Photo


Senior Advisor
2,700 posts

You'll still need to check over the pages to make sure the changes (especially if you changed any sizes of things) don't affect other areas of the page, but it is still a pretty quick way to make simple global changes. :)


Yea I have made this mistake more than once especially when you start duplicating pages and editing the new page! The first couple of times I did this I went back to my original page and it was all messed up because the changes I made to the new page. Remember if you are changing something on a duplicated page to select ID from the drop down when you want to change something only on the page you are working on.
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 10077 Photo


Senior Advisor
1,021 posts

Just to make sure I understand, when you are talking about using templates and comparing it to Dreamweaver, you want to create one template that is used as the layout for the whole site (or for a section) so that if you make a change to the template, it automatically propagates the change to all pages that use the template. Is that correct?

If so, here is how you can use RLM to do the same thing as long as you know a little PHP. This method does not utilize a database, but it is actually great with a database.

1. Template Creation
Remember "Editable Regions" from Dreamweaver? When you are creating your template in RLM, think in those same terms. You won't call them "Editable Regions," but think in terms of the areas where your content will go. Export the RLM site into your Editor Project. Be sure it is in its own folder.

IMPORTANT NEXT STEPS:
-- Copy the html pages to the root (or the folder where they will reside).
-- Add 'tpl_' to the front of the template filename so you know that it is a template. (Ex: tpl_mainpages.php)
-- If you haven't already, change the extension from .html to .php
-- Change the css links in the <head> to reference the folder where you exported your RLM files.

<link rel="stylesheet" href="rlm_exported/css/coffeegrinder.min.css">
<link rel="stylesheet" href="rlm_exported/css/wireframe-theme.min.css">
<link rel="stylesheet" href="rlm_exported/css/main.css">


2. Set Up Your Exported Files As Templates
Remember the "Editable Regions" that you left in your template? Assign each one a variable name and put a PHP echo statement in each one. This includes the data for the <title> and <meta> tags in the <head> as well as any area that would have custom information.

<html>
<head>
<title><?php echo $head_title; ?></title>
<link rel="stylesheet" href="rlm_exported/css/coffeegrinder.min.css">
<link rel="stylesheet" href="rlm_exported/css/wireframe-theme.min.css">
<link rel="stylesheet" href="rlm_exported/css/main.css">
</head>
<body>
<div class="leftbox" style="float:left; width="300";><?php echo $left_text_box; ?></div>
<div class="pagebody"><?php echo $page_body; ?></div>
<div class="otherregion"><?php echo $other_editable_region; ?></div>
</body>
</html>


3. Create the Pages of Your Site
For each page of your site, create the page, but instead of making it a standard html page, it should be a .php page. (Ex: index.php) For the code on the page, put the content in each variable and then include the template.

<?php
$head_title = 'My Page Title Here";
$left_text_box = 'HTML for the left text box goes here. Don\'t forget to escape the "quotes".';
$page_body = 'HTML for the page body goes here. Same thing about escaping quotes.';
$other_editable_region = 'Each region on the template should have it\'s own data.';
include('tpl_mainpages.php');


3. CSS Changes
If you need to make css changes, you can make them in RLM and re-export to the same folder without affecting your site and without having to do additional file copying. Just upload the exported folder to the server and the CSS updates are made for the site.

4. Layout Changes
Now even layout changes are a breeze! Make your change in RLM and export. Copy the code from the exported html onto the template to which it applies. You don't have to re-enter all your content. Simply, add the php echo statements back in to the template, and the changes are applied to every page that uses that template.

Managing the content (Step 3 above) is much easier if you do all this with a database. If you'd like help with that, please email me at support@usconsumernet.org.
How-To Instructions for Coffeecup Users (tutorials, examples, and downloads)
http://usconsumernet.net/help-for-coffe … -users.php

Personal & Specialized Help for Coffeecup Users
Email me at cchelp@uscni.org or call 865-687-7698

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.