How to exclude images from Plone navigation tree by default - plone

I notice that if I make a page and add and upload an image to include in it, by default it is included in the site navigation. How can I stop this from happening automatically?

Option 1
There is a Plone setting which tells which types are included in the navigation. Go to ZMI > portal_propeties > navtree_properties > metaTypesNotToList and add Image there.
Option 2
For each image, toggle checkbox "Exclude in navigation" on Image's Settings tab.

if you need to do so on a container basis, you could use the content rule included in sc.contentrules.metadata.
just add it to your buidout and configure it manually to set the ExcludeFromNav field to True.
an alternate way to do so is to include a contentrules.xml in your project profile with something like this:
<?xml version="1.0"?>
<contentrules purge="True">
<rule name="exclude-on-add" title="Images are excluded from navigation when added"
description="" enabled="True"
event="zope.lifecycleevent.interfaces.IObjectAddedEvent"
stop-after="False">
<conditions>
<condition type="plone.conditions.PortalType">
<property name="check_types">
<element>Image</element>
</property>
</condition>
</conditions>
<actions>
<action type="sc.contentrules.actions.ExcludeFromNav">
<property name="exclude">True</property>
</action>
</actions>
</rule>
<assignment name="exclude-on-add" bubbles="True" enabled="True" location="/your-container"/>
</contentrules>

You have the options for Navigationin the Site Setup menu.
Remove the tick on image for displayed content types and images are not longer shown on site navigation and site maps.

Related

Fishpig 3 column layout not working in page/post

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.

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.

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.

Add css to only homepage from xml in magento

Want to include css file which is applicable to only homepage from xml file.
Tried this :
<cms_index_index>
<action add css>
.
.
</action>
</cms_index_index>
using this in local.xml adds that particular css in every cms page.
Any Idea ?
Thanks in Advance.
In the cms home page there is Design(Layout Update XML)
use the following code in that
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/myjavascript.js</name></action>
</reference>
this solution work for me
<cms_index_index translate="label">
<label>CMS Home Page</label>
<reference name="head">
<action method="addCss">
<stylesheet>
css/custom.css /*This is ur css path*/
</stylesheet>
</action>
</reference>
</cms_index_index>
Try this
<cms_index_index>
<reference name="your cms identifier for home page">
<action method="addCss"><stylesheet>your path/your css file name</stylesheet></action>
</reference>
</cms_index_index>
Please use this code in local.xml or page.xml
Am not 100% sure about the code work or not
In combination with #Leo's answer as well as another blog post I found recently, here's a code snippet to add custom css to just a single page only.
<reference name="head">
<action method="addCss">
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>
Same instructions as #Leo mentioned.
The above suggestions didn't work for me in Magento 1.7, blank theme. What worked was this:
<reference name="head">
<action method="addCSS">
<type>css/master.css</type>
<stylesheet>media="all"</stylesheet>
</action>
</reference>
This produced the following code
<head><link rel="stylesheet" type="text/css" href="http://myshop.com/shop/skin/frontend/mytheme/blank/css/master.css" media="all"></head>
I placed this code into the local.xml of my theme.

Alfresco 4.0d Custom Aspect Search

I'm currently developing a custom search in Alfresco for some custom aspects that I've created . Can you direct me to the correct xml file which I need to edit to add my custom aspects in the search? I have researched numerous posts on the web but I couldn't find anything...
Explain better,
do you mean the default advanced search in Alfresco Explorer?
In that case, you should search for a file named web-client-config-custom.xml.sample inside:
/Alfresco/tomcat/shared/classes/alfresco/extension
or
/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension
Then rename the file removing the sample extension, to have web-client-config-custom.xml and copy the file inside the first path above (the "shared" one, not the webapps/alfresco one);
Then, inside, search for a tag named "config evaluator" Advanced Search, it should be something like this:
<!-- Example of configuring advanced search -->
<!--
<config evaluator="string-compare" condition="Advanced Search">
<advanced-search>
<content-types>
</content-types>
<custom-properties>
<meta-data aspect="app:simpleworkflow" property="app:approveStep" />
</custom-properties>
</advanced-search>
</config>
-->
There, you can add your custom aspects that you created in your customModel.xml file.
To extend the custom advanced search capabilities, you could add some custom content type search or properties that are not part of the aspects, like this:
<config evaluator="string-compare" condition="Advanced Search">
<advanced-search>
<content-types>
<type name="myNamespace:customType" />
</content-types>
<custom-properties>
<meta-data type="myNamespace:customType" property="myNamespace:customTypeProperty" />
<meta-data aspect="myNamespace:customAspect" property="myNamespace:customAspectProperty" />
</custom-properties>
</advanced-search>
</config>
hope it helps..

Resources