I am using zend navigation in my site and I have the following navigation.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<page1>
<label>Site</label>
<uri>/</uri>
<pages>
<page1_1>
<label>Home</label>
<uri>/</uri>
</page1_1>
<page1_2>
<label>News</label>
<uri>/news</uri>
</page1_2>
<page1_3>
<label>Contact</label>
<uri>/contact</uri>
</page1_3>
</pages>
</page1>
</nav>
</config>
Then I render the menu like below
<?=$this->navigation()->menu();?>
Output
- Site
- Home
- News
- Contact
Wanted Output
- Site
- Home
- Contact
How can I remove News item from the menu without affect other menu rendering?
Vou can hide menu entries with visible flag, that you add to the entry you would like to hide, in your case <page1_2>...</page1_2>:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<page1>
<label>Site</label>
<uri>/</uri>
<pages>
...
<page1_2>
<label>News</label>
<uri>/news</uri>
<visible>0</visible>
</page1_2>
...
</pages>
</page1>
</nav>
</config>
Only use 0 or 1 within the xml file because false or true aren't recognized. All possible options you will find at Zend Framework: Documentation: Pages - Zend Framework Manual.
If you want the invisible entry in the breadcrumbs menu you can temporally disable the visible flag by adding setRenderInvisible( true )
<?= $this->navigation()->breadcrumbs()->setRenderInvisible( true ); ?>
All options of this helper you find here.
Try using this:
<visible>0</visible>
Related
My Plugin is by default display on middle bottom of Eclipse, how could I make it to display at right side of Eclipse?
My plugin.xml looks like below, any hints will be more than welcome!
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.views">
<category
name="My Plugin"
id="com.xx.plugin">
</category>
<view
name="XX my plugin View"
icon="icons/sample.gif"
category="com.xx.plugin"
class="com.xx.MyPluginView"
id="com.xx.MyPluginView">
</view>
</extension>
</plugin>
You use the view element of the org.eclipse.ui.perspectiveExtensions extension point for this. You have to do it for each perspective you want to customize.
Something like the following should show the view in the same stack as the outline view at the right in the Java Perspective.
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
relative="org.eclipse.ui.views.ContentOutline"
visible="true"
id="com.xx.MyPluginView"
relationship="stack">
</view>
Note: You may have to reset the perspective to get the extension picked up.
I want to following features in buttons in android button:
Buttons should change colours when clicked
Some specific buttons have features like the background color of button should remain changed until we press another button.
For rounded corners you can use below code :
#drawable/rounderd_corner.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#android:color/transparent" />
<stroke
android:width="1dp"
android:color="#color/YOUR_COLOR" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
And For selector Buttons use below #drawable/select_button_color.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#color/YOUR_COLOR" />
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
And Change background resource when button is clicked
For circular and for changing color when selected/not-selected button you can use following code snippet
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false">
<shape android:shape="oval">
<solid android:color="#color/colorPrimary"/>
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="#color/colorPrimaryDark"/>
</shape>
</item>
</selector>
And you problem will be solved, hope it helps.
Cross-post from Adobe Community Forums: http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__qugo-we_have_an_imagecom.html
We have an image component, its _cq_editConfig.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
cq:disableTargeting="{Boolean}true"
jcr:primaryType="cq:EditConfig">
<cq:dropTargets jcr:primaryType="nt:unstructured">
<image
jcr:primaryType="cq:DropTargetConfig"
accept="[image/.*]"
groups="[media]"
propertyName="./fileReference">
</image>
</cq:dropTargets>
</jcr:root>
We have a page component ("Blurb") which includes this component as the "featuredImage", as well as a "body" parsys which allows the same component to be used:
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="sitename/components/plainText"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="sitename/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
If I place a sitename/components/image component in the parsys, I can drag an image from the content finder onto the component to set it. The featuredImage, however, will not accept the drag-n-drop from the content finder (the "not allowed" cursor appears, dropping the image does nothing). If I open the featureImage's edit dialog, I can drag a content finder image to there. I am the admin user, there are no permission restrictions.
The same issue applies to text components configured for inline editing. When the text component is placed in the body parsys (or any parsys), the inline editor works. When the text component is placed outside of the parsys (Page Title in the example above), the inline editor will not appear.
Interestingly, when I change the Blurb page component use foundation components, the featuredImage drag-n-drop works, but the pageTitle inline editing does not.
<div>
<h1>*Page Title</h1>
<cq:include path="pageTitle" resourceType="foundation/components/text"/>
</div>
<div>
<h1>*Featured Image</h1>
<cq:include path="featuredImage" resourceType="foundation/components/image"/>
</div>
<div>
<h1>*Body</h1>
<cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>
Is this a WCM bug? Are our components' cq:editConfig definitions missing something?
EDIT: This is running on AEM 5.6.1.
Our Image component's .content.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Image (Custom)"
sling:resourceSuperType="foundation/components/image"
allowedParents="[*/parsys]"
componentGroup="Site Name Group"/>
And dialog.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<advanced
jcr:primaryType="cq:Widget"
path="/apps/sitename/components/image/tab_advanced.infinity.json"
xtype="cqinclude"/>
<image
jcr:primaryType="cq:Widget"
path="/apps/sitename/old/components/image/dialog/items/image.infinity.json"
xtype="cqinclude"/>
</items>
</jcr:root>
And the cqinclude'd /apps/sitename/components/image/tab_advanced.infinity.json
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Panel"
title="Advanced">
<items jcr:primaryType="cq:WidgetCollection">
<image
jcr:primaryType="cq:Widget"
collapsed="{Boolean}false"
collapsible="{Boolean}true"
title="Image"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<title
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldDescription="Required Field: If the Alt Text field is left blank, the image title will be used instead. "
fieldLabel="Image Title"
maxLength="{Long}60"
name="./jcr:title"
xtype="textfield"/>
<linkUrl
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: use the link field to specify where the image ought to link to."
fieldLabel="Link to"
name="./linkUrl"
regex="/^\\S*$/"
regexText="Please enter a valid link"
xtype="pathfield"/>
<alt
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: When text is entered into the Alt text field it will be used instead of the image Title. If the image is used as a link, the Alt text is used for the name of the link. For example <a href="http://slipsum.com/"> Visit Samuel L. Ipsum</a>"
fieldLabel="Alt Text"
maxLength="{Long}100"
name="./alt"
xtype="textfield"/>
<description
jcr:primaryType="cq:Widget"
fieldDescription="Optional Field: used to populate the image caption"
fieldLabel="Caption"
maxLength="{Long}256"
name="./jcr:caption"
xtype="textarea"/>
</items>
</image>
</items>
</jcr:root>
And /apps/sitename/old/components/image/dialog/items/image.infinity.json
<image
jcr:primaryType="cq:Widget"
allowUpload="{Boolean}false"
ddGroups="[media]"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
name="./file"
requestSuffix=".img.png"
title="Image"
xtype="html5smartimage"/>
Sample package for testing (with the text component inline editing) at: http://s000.tinyupload.com/index.php?file_id=05420490884931180108
Since I don't have the full source I can only guess which problem you are actually experiencing. I see one of the following as the possible reasons:
You either do not provide the CQ editor classes as described here
Your custom parsys is misconfigured, try replacing it with the foundation one.
I tried to reproduce the issue, but didn't succeeded, it's working for me. I created this sample project for you.
In my plugin/RCP I have defined my own contributions to Eclipse universal intro with page definitions inside the toplevel xml (the one pointed to by the "config" attribute to the "configExtension" element of the org.eclipse.ui.intro.configExtension extension point), which works.
However, I'd like to split out the page definitions to separate files for simpler editing and managing.
So I start out with (in my intro/introcontent.xml):
<page id="myfirststeps" style="$theme$/html/firststeps.css" style-id="page">
<!-- Page content here -->
</page>
And this works. The intro displays the page content correctly. Then I move the page content to firststeps.xml:
<?xml version="1.0" encoding="utf-8" ?>
<introContent>
<page id="myfirststeps" style="$theme$/html/firststeps.css" style-id="page">
<!-- Page content here -->
</page>
</introcontent>
and change the toplevel xml to say:
<page id="myfirststeps" content="intro/firststeps.xml" />
does not work. Running this creates a "File not found" exception, and the file indicated is pointing into the Eclipse installation (like "C:\Program Files\Eclipse") and not, as I would have expected into my plugin. And sure enough, if I copy my xml-file there it finds it.
Any pointers? Is there some trick about the content attribute and how it resolves the path to the file?
Or is there a way to specify a path to the plugin directory in the content attribute?
I'm using Eclipse 3.7.
Turned out that the solution was simple. The file reference in the content attribute is relative to the referencing xml-file, not relative to the plugin-root.
So all I had to do was to remove the "intro"-part of the path. From
<page id="myfirststeps" content="intro/firststeps.xml" />
to
<page id="myfirststeps" content="firststeps.xml" />
And all is well.
I'm using Magento 1.5.0.1 and I want to move my advanced search form to the sidebar for my 2columns-left template.
What I've tried was this:
<reference name="left">
<block type="catalogsearch/advanced_form" name="catalogsearch_advanced_form" template="catalogsearch/advanced/form.phtml"/>
<block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/>
</reference>
But unfortunately it doesnt show up.
When i browse to mywebsite/catalogsearch/advanced/ the form shows up in the sidebar so that goes well.
How can i change it so it always shows up in the sidebar?
Thanks in advance!
What happens if you insert into your template:
<?php echo $this->getLayout()->createBlock('catalogsearch/advanced_form')->setTemplate('catalogsearch/advanced/form.phtml')->toHtml() ?>
Also pay attention that .js files are loaded for calendar.