Fishpig 3 column layout not working in page/post - wordpress

Followed these instruction to display a 3 column layout for page/post:
fishpig layout XML.
Used the local.xml of the theme in app/design/frontend/my_theme/default/layout/local.xml
but view is still default 2 column layout.

I have looked into this and tested a few things on your site (you provided access details via email) and found that the code at this link does in fact work. The extension uses the layout handle 'wordpress_{{post_type}}_view' for each different post type. Therefore, for posts, you can change the root template with the following XML:
<wordpress_post_view>
<reference name="root">
<action method="setTemplate"><template>page/3columns.phtml</template></action>
</reference>
</wordpress_post_view>
I have tested this on your site, added it to your theme's local.xml file and refreshed the layout cache. This has correctly changed the root template of your blog posts to the 3 column layout.
For pages, I used the following XML code:
<wordpress_page_view>
<reference name="root">
<action method="setTemplate"><template>page/3columns.phtml</template></action>
</reference>
</wordpress_page_view>
Again, I added this to your local.xml file, refreshed the cache and then your Pages had a 3 column page layout.

Related

Diazo - on error show message (when you get the content from a page)

Can we skip a diazo error and prevent page crash by replacing it with a nice message in page? Something like: Your content you want to show in this page is not created or published. Please check this section /source/homepage-content-sample-section.html.
<!-- Images slider section -->
<replace css:theme="[data-diazo='my-images-slider']"
href="homepage-content/homepage-images-slider" method="document"
css:content-children="#content-core" />
<drop css:content="#content-core [data-diazo='my-images-slider']" />
I have a page in Plone for each section in Homepage, that contains html code easy to edit. The problem is if a page is missing or private the homepage is broken.
Calling user-managed contents with href in a Diazo rule is like playing Russian roulette. If the page is not existing, there is not way to prevent the page crash.
The best approach is to call a developer-defined URL in charge of retrieving the content if it exists and that will just gently return nothing if the content does not exists.
Rapido is a very easy way to do that (you create a Rapido block which can be called like that: href="##rapido/myapp/blocks/get-content-for-my-homepage", this URL will always work, your page will never crash whatever the users have done with the content).

Magento : How to put already created static block after all product listing and end of the sidebar in magento?

I have 2 column left sidebar theme in magento. I have 3 static block already created. Now i want to display these blocks after all product listing and before footer. How can i do ?
I already tried out but these blocks are mixed up with new product.
how familiar you are creating a extension and ad your custom code?. if I understand correctly you want to display 3 different static blocks before footer but after the product list right? in the main column.
Here is what I doing if I need to add something static only for the product list.
You need to create a local.xml file under your package/theme in layout using in your site.
<!-- Catalog Category (Anchor) -->
<catalog_category_layered>
<reference name="content">
<block type="cms/block" name="cms_footer_links" after="category.products">
<action method="setBlockId"><block_id>static_block_1_identifier</block_id></action>
</block>
<!-- Add the same for the rest of the other static blocks 2 and 3 -->
</reference>
</catalog_category_layered>
Add the same code to the N-Anchor Display mode
<!-- Catalog Category (Non-Anchor) -->
<catalog_category_default>
<reference name="content">
<block type="cms/block" name="cms_footer_links" after="category.products">
<!-- The content of this block is taken from the database by its block_id. You can manage it in admin CMS -> Static Blocks -->
<action method="setBlockId"><block_id>static_block_1_identifier</block_id></action>
<!-- Add the same for the rest of the other static blocks 2 and 3 -->
</block>
</reference>
</catalog_category_default>
I did without testing the code but I think should be work, let me know if you have any problem with the code and we can review.

How do I link the logo to an external site?

I would like to change the link in the Plone logo viewlet. By default it points to the Plone site root, I want to point it to a location that is not within the Plone site.
I tried writing a custom logo viewlet, but this seems very complex for such a small change. What is the best way to do this?
The easiest way to change the Logo link is to override the logo viewlet template. This is best done with z3c.jbot.
You need to add z3c.jbot to your projects custom product, by adding it as a dependency in setup.py, and also set up the configure.zcml correctly:
<include package="z3c.jbot" file="meta.zcml" />
<browser:jbot
directory="templates" />
Don't forget to make sure you have the browser prefix added in the <zcml> tag.
You can now copy the logo.pt file from plone.app.layout to the templates directory in your custom product. Rename the file to plone.app.layout.viewlets.logo.pt and change:
tal:attributes="href view/navigation_root_url;
title view/navigation_root_title"
To:
href="http://stackoverflow.com"
Restart the server, and the logo link has now changed.
Alternatively you can edit it via ZMI (/manage) in portal_view_customizations. And search for the "plone.logo" view.
It should open this url in the frame:
/portal_view_customizations/zope.interface.interface-plone.logo/pt_editForm

where to put css in Magento

I have a layout.xml file that triggers and runs properly, but my css does not seem to work.
...
<my_handle_name>
<reference name="head">
<action method="addCss">
<stylesheet>css/mystyles.css</stylesheet>
</action>
</reference>
</my_handle_name>
...
EDIT
I have a folder structure something like this,
magento->skin->frontend->enterprise->myfolder->css->mystyles.css
and it appears that magento is looking in
magento->skin->frontend->default->default->css->mystyles.css
how can I edit the layout.xml to go to this directory?
if your other setting is working perfect then you have to set your package name and your myfolder in back end for default configuration if you don't have any store, i assume you have only one default store
then go to this step in Admin
System -> Configuration -> design then set your package name instead of default and also set your theme name instead of default theme
Below is the detail link you can get more idea from it
Custom theme assets belong under the base/default theme. Based on your layout XML, your custom CSS file belongs in skin/frontend/base/default/css/mystyles.css.
Convention is to put your file in a namespaced subfolder to prevent potential collisions with end user files.

Magento: Fishpig/Wordpress extension not parsing local.xml on Post pages

So I setup Fishpigs Wordpress extension about a month ago on my Magento site and all was working well. Somewhere, somehow in the last week the formatting went haywire. Tracking down what went wrong, I found that the post pages stopped using my custom .phtml layout ('wordpress.phtml'). All other wordpress related pages use the template properly though.
I had added
<wordpress_default>
<reference name="root">
<action method="setTemplate"><template>page/wordpress.phtml</template></action>
</reference>
</wordpress_default>
in my local.xml and all was good. Today I even tried setting all the layouts in the extension settings and same deal, only the post page isn't rendering the correct layout. This is a strange problem, I'm not sure where to start looking...
I see three possibilities here (assuming you've already performed the holy rite of clearing your cache storage)
The request for the post page isn't loading your local.xml file, possibly because its using a different theme and/or design package
The post page isn't issuing the wordpress_default handle, so although your local.xml file is being included, your setTemplate action is never called
There is a layout update that's called after your layout update (either via XML or directly in PHP code) which sets the root template to something else.
Investigate each of these three items and you should find your answer.
Regarding choice #3, I don't have an installation with the FishPig extension installed and haven't used it extensively, but it looks like the extension does some jiggery pokery in ViewController.php to automatically set the template to page/1column.phtml if the wordpress page object (? I don't know what this is) has a field set to 'onecolumn' or '1column'.
parent::loadLayout($handles, $generateBlocks, $generateXml);
if ($this->_getPage()) {
$keys = array('onecolumn', '1column');
$template = $this->_getPage()->getCustomField('_wp_page_template');
foreach($keys as $key) {
if (strpos($template, $key) !== false) {
if ($rootBlock = $this->getLayout()->getBlock('root')) {
$rootBlock->setTemplate('page/1column.phtml');
}
break;
}
}
}
I'd start looking there.

Resources