Why is my PyroCMS not building the view I tell it to? - pyrocms

Here is my controller code:
$this->template
->set_breadcrumb( 'my stuff )
->set('questions', $questions)
->set('categories', $categories)
->build('index');
However, it doesn't seem to actually build the index view. It's building my default.html view in my theme.
Ideas?

I don't understand this question or the accepted answer. It will always build the default.html because that is the default layout.
The contents of the index go into {{ template:body }} which you should be echoed out in your layout of choice.

You can't have default.html as a view.

Related

Laravel #push not working in create_category.blade.php

Created a template folder inside views folder and in header.blade.php and added the following code
<ul id="sidebar">
#stack('sidebar')
</ul>
And created another category.blade.php inside views folder and added the following code
#include('template/header')
#push('sidebar')
<li>Sidebar first</li>
#endpush
A #stack can only be defined in an outer layout. So if you want to use #push, you have to use #extends('template.header') instead of #include('template.header').
In your case I don't think it is okay to use #extends you probably use an other layout file.
I searched for it in the Laravel issues and I found this Thread. Maybe this can clarify some things for you.
This can be particularly useful for specifying any JavaScript libraries required by your child views
better to use #include insted #push and #stack

Joomla 3 category blog article override

Im trying to override the article layout for articles showing in the category blog layout. I have overriden the blog.php file from the folder components/com_content/views/category/tmpl into mytemplate/html/com_content/category, but this only overrides the category blog layout, not the layout of the actual articles.
The bit i need to override is the bit that loads inside here,
<article class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>" itemprop="blogPost" itemscope itemtype="http://schema.org/BlogPosting">
<?php
$this->item = & $item;
echo $this->loadTemplate('item');
?>
</article>
Any ideas how to do this without overriding every article on the site.
Thanks.
you should override this file:
components/com_content/views/category/tmpl/blog_item.php
Read More:
Customize Your Joomla Templates by Learning Overrides
You need to create another template over for the single article view. Place files to override from here:
components/com_content/views/articles/tmpl/
In here:
templates/myTemplate/html/com_content/article/
You can keep the names the same and every Article will use this template to render, or you can rename and manually assign the template to individual articles as needed.
Some links on the details on template overrides.
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
http://docs.joomla.org/Understanding_Output_Overrides
http://docs.joomla.org/Layout_Overrides_in_Joomla
Try to override the following tmpl files :"category/blog_item.php", "category/default_articles.php" and "article/default.php"

first time jekyll user - confused about 'page links'

So I finally got a blog going on gh-pages branch in a github repository using jekyll, and the theme lanyon. I love it. But something still bothers me.
On pages, the 'link' at the top of the article seems to default to a url I haven't really specified. This is what the top of my [YYYY-MM-DD-NAME].md files looks like...
---
layout: post
title: Page Name Here
---
Now, it renders okay, but Page Name Here shows up at the top, and is clickable, but I cannot figure out where to set the base url that it goes to. As it renders now, it does ...
[site root]/[page full filename]
but it should be ...
[site root]/[repo name]/[page full filename]
And I'm not clear on which variable in _config.yml I need to set to make this work right. Any suggestions?
As you're using Jekyll Bootstrap a post url tag is like this :
{{ post.title }}
You could also work with creating a url variable in _config.yml
url: www.website.com
and then creating a layout for posts with.
{{ post.title }}

How do I include the homepage in the Sphinx TOC?

Let’s say I’ve got a Sphinx project with the following sources:
index.rst
installation.rst
templating/
index.rst
module.rst
fieldtype.rst
index.rst (the homepage) has the following TOC tree:
.. toctree::
:titlesonly:
installation
templating/index
I want my template to include a sidebar that lists all 3 top-level pages (homepage, installation, templating/index).
I've tried adding a second, hidden TOC tree in the homepage:
.. toctree::
:hidden:
index
.. toctree::
:titlesonly:
installation
templating/index
That actually gives me the desired result, except that it makes the next variable set to the current page. So this code in my template:
Next up: {{ next.title }}
…always outputs the homepage link from the homepage. No good.
I’ve always tried to hardcode the actual homepage link right into the sidebar of the template:
{% set homeClass = 'current' if pagename == 'index' else '' %}
<ul class="{{ homeClass }}">
<li class="toctree-l1 {{ homeClass }}"><a class="{{ homeClass }} reference internal" href="/index.html">Home</a></li>
</ul>
{{ toctree() }}
That also works, except that I don’t want to force the docs to be accessed on the webroot of a web server – I want them to work from the file system too.
I can’t simply set the URL to “index.html” because that won’t work when you’re in a file within templating/.
Am I missing something obvious? There must be a way to get the homepage into the TOC, without breaking next links and with a dynamic path that works on a local file system, even from within subfolders.
Turns out the answer was hiding in plain sight on Sphinx’s TOC tree page:
The special entry name self stands for the document containing the toctree directive. This is useful if you want to generate a “sitemap” from the toctree.
Adding self to the TOC tree did the trick perfectly! And if you place it in a separate, hidden toctree directive, it won’t show up on the homepage’s table of contents either:
.. toctree::
:hidden:
self
.. toctree::
:titlesonly:
installation
templating/index
Is it possible for you to rename your Sphinx project's root toctree page, or, alternatively, the templating/index page? The master_doc variable lets you name the file in your project that contains the root toctree directive, and it doesn't have to be called index.rst... in our documentation project to get around a problem very like this, we have a template/index.html file and our root toctree page is actually called reference.rst.

Codeigniter URL for navigation

I can't figure out how to do the url links.
Basically I have my navigation bar, and I don't know which CodeIgniter URL code to use and how to implement it.
Is what I'm doing here right?:
<?php $this->load->helper('url'); ?>
<li>About Us</li>
I tried to do an anchor like this, but when I load the page it just turns up blank:
<?php echo anchor('views/about.html', 'About Us', title='About Us'); ?>
What am I doing wrong?
There are two ways to make links:
CodeIgniter helper style:
<?php echo anchor('about', 'About us', 'title="About us link"'); ?>
More common HTML with URL echo:
About us
Both will output:
About us
Though if I understand what you are trying to achieve, your mistake is elsewhere.
You don't include the views part, as your URL should point to the controller, not a view. The only case is if you have a controller named views.
CodeIgniter is set up so that it doesn't include file extensions like .html in URL's by default. It does if you've set them up in your config file in $config['url_suffix'] = '';, which is null by default.
See if you've made any of these mistakes.
That is another way on how you do the URL if you are using the URL helper in CI. You should try this, make the base_url() as the value for href. Try this,
About Us
You have to try like this
About Us
or you can give like
About Us
and in the "about" function you put
$this->load->view('about');
but i think the firstone will works for you fine.

Resources