PyroCMS: How to include one page inside another - codeigniter

I have a site with an "About us" page which is divided into multiple sections.
About Us
+Overview
+The Company
+Our services
+Future plans
(etc)
I want to have a floated block on the right hand side of each of these pages which contains links to every other page.
Ideally, what I would like is to create a page titled AboutUsSidebar, and then be able to include this page in all of the about sections through some kind of tag, ie..
{include('Sidebar')}
Is there anything like this in PyroCMS? Or perhaps a better way to do it?

You should use view partials.
Create your sidebar with it's HTML and save it into addons/shared_addons/themes/yourtheme/views/partials/sidebar.html and then you can include it in your layouts as so:
{{ theme:partial name="sidebar" }}

It looks like page types are the way to go, I didn't see the page types button at the top of the page before.

In the end what I was able to achieve the desired result by using a page type.
I have a page type called "About" which contains the sidebar html, then I use pages on top of that page type for each of the sections.
Worked very nicely.

Related

Top level navigation from html link in code in Markup slice

I had seen a comments that Apache Superset was edited to allow user activation of top level navigation for links in a Markup slice (so clicking a link redirects the page instead of just the contents of the slice). Does anyone know how to enable this option?
You can use HTML coding in the mark-up.
It works

How to include hooks in CMS pages?

I've created a custom hook, so that I can include my custom module in any .tpl file by a single line: {hook h='calcSubstrate'}.
However, I can't use it in CMS page, at least not by using the admin panel - including smarty code in a CMS page won't render, the code would appear just as it is, as a text: {hook h='calcSubstrate'}.
Alternatively, if that would be easier/faster - how can I choose on which pages my module would appear?
The editor for CMS page won't recognize any Smarty code. To include hooks in chosen articles/pages, I can think of two options:
Include the hook in the template (cms.tpl), and check for the id of the current page to conditionally display the module. The list of the page ids can be made as the module's configuration.
Build a module to add functionality similar to Wordpress's shortcode to the CMS content. I do this with module instead of overriding the CmsController class, hence I have to display the content with {$cms->content|module}. You can look at the simplified code here for inspiration: https://gist.github.com/tungd/cef0ca1ac1063c1ee90b. Of course you can make it more generic like Wordpress, by having only one Smarty modifier do_shortcode that does everything (just like Wordpress's do_shortcode function).
Last time I did this it was because my client want to put slideshows in some CMS pages, and I chose the second approach because it gives a lot of flexibility about when the module is displayed and where it is displayed between the content. For something else, for example Contact Form, or Map, this would be overkill and the first approach is better.

Magento Anchor Tags

I have a list of FAQ links on my home page in a static block in the footer. Each link however just opens up the FAQ page.
My code sample
What is Individually Quick Frozen?</li>
What I want is that when a user clicks a particular link in the list on the homepage footer under FAQs (as above), the user should be directly be taken to the answer of that question on the FAQ page i.e. the page should scroll down to where the questions is answered.
My Code sample
<p><strong><a id="1">What is Individually Quick Frozen?</a></strong></p>
But no joy! what am I doing wrong?
Make your link look like this:
What is Individually Quick Frozen?</li>
or better yet
What is Individually Quick Frozen?</li>
Note: For Cms pages urls use direct_url as a parameter for the {{store}} directive. It avoids having a / at the end of the URL. Useful if your pages end with .html. It's not your case but it may be useful in the future.
Now your code in the cms page should looks like this:
<p><strong><a id="_1">What is Individually Quick Frozen?</a></strong></p>
Avoid using numerical ids for elements. It's not standard
Worked perfectly, be sure to update
<a href="{{store url="faqs"}}#_1">
"faqs" to what ever page you want your tag to land on though.

create dynamic template for joomla 1.5

there are tutorials on the web about gow to create index.html, css file and template.xml that contain placeholders. ok, i got it, it's simple. but i need a template that has some different views. for example:
-all pages have a topmenu, header, left sidebar, mainarea and a footer but:
-first page has no header .topmenu after which sidebar, mainarea and footer comes.
-second page has sidebar moved from left to right
-third page has four blocks (blocks for special offers) instead of mainarea.
as far as i can see, i need to create three standalone templates with unique set of placeholders for each template. because i can't see the way to change laarge mainarea placeholder with four placeholders for offers blocks on some pages. dynamically.
is there if-statements in joomla templates to simply determine a document id to view four placeholders instead of mainarea. or to not show header on the main page (f.e. doc. id="mainpage")
but i want it to be selectable like:
-this page has first case of that template (index_1.php)
-and that page has a second case of the same template (index_2.php)
like a selectbox.
is that possible?
I will make this an answer as opposed to a comment since I believe it will do what you are looking for.
Once your articles are setup and your links to them are established (the site has the info on it you're looking for), you can create the modules containing the data that you want shown from time to time.
Go to the module manager - on the right you should see 'module assignment' or something along the lines of 'display this module on the following pages'; you can then pick which pages you want the module to show on. You can specify all pages, none, specific pages, however you want.
This will enable you to show them only where needed however you like.
You can ALSO do this programatically inside the module (if you do custom HTML and use an extension like Sourcerer to add PHP to the module) with PHP should you want a little more flexibility, but just choosing the pages to show on should work for what you're doing.

Is there a way to tell Google, certain elements are irrelavent to page?

I have a page that shows the main product for that page, next to it though are "related products" which when you click on them you go to their page, and they have their own related products as well. The problem is that the related products are getting indexed by Google so when you search for product-A you may get the product-B page where product-A is a related item, instead of just getting the product-A page. I am trying to prevent this. Any ideas?
Thanks!
You can add rel="nofollow" in any links you don't want a bot to crawl. In this case, you can apply that tag to all your links and google won't follow them off your main page.
http://en.wikipedia.org/wiki/Nofollow
EDIT for clarification:
Page "A" is for widgets. You want this page to be returned for searches regarding widgets; on this page is a "related searches" section which links to Other Widgets. On all the anchor tags on page "A" which link to pages "B" and "C" (the related searches for Other Widgets), you'll put a rel="nofollow" tag. This will prevent Google from hitting page A and then following your "related searches" links off to pages "B" and "C".
This will NOT prevent pages "B" and "C" from being indexed on their own, it just prevents them from getting pulled in from page "A".
EDIT#2:
rel="nofollow" tells bots you don't want them to follow the link to the second page. Regardless of the anchor text on a link from A->B, if you've nofollowed it the bot won't "flow" pagerank to the linked-to page and should not follow the link to page "B" to index it due to that tag on the anchor. Note that this is not foolproof: Yahoo and other SE's may not treat nofollow like Google....so your best bet is to make sure that each page is strongly on-page-SEO'd such that it gets included in the index for the term you want it to be included for. Hope this helps...but like much of the SEO world there are few hard-and-fast rules which apply universally.
yes... put them at the bottom of the page for content,
if you want that to appear visually at the top of the page, use a css layout to re-arrange the page elements
also, as darksquid already said, add rel="nofollow" to links you don't want considered
another tip (pertaining to your comment on darksquid's post):
You could load the content via ajax, which would keep most search engine spiders from seeing it at all (since they don't generally execute javascript)
Use Google Applicance - googleoff / googleon Tags:
http://www.geekzilla.co.uk/ViewC8614968-56ED-4729-9C12-F01677DAC412.htm

Resources