I am trying to create custom top links.
I do not have idea of how to place block in page.xml and any other layout file.
I do not have idea of how Magento default top links work.
If I want to create custom top links what should I do?
Add this code in page.xml
it should be child block of header block.
<block type="page/template_links" name="customlinks" as="customlinks"/>
Add this code in customer.xml
<default>
<reference name="customlinks">
<action method="addLink" translate="label title" module="customer">
<label>Register</label>
<url helper="customer/getAccountUrl"/>
<title>Register</title>
<prepare/>
<urlParams/>
<position>10</position>
</action>
</reference>
</default>
add this code in your header.phtml file
<?php echo $this->getChildhtml('customlinks') ?>
it will display link 'Register'
Related
I'am a beginner in jsf and I want to open an html page in a p:dialog.
When I use the <ui: include> to display the page like this:
<p:dialog header="Dialog"
widgetVar="dlg"
resizable="false"
dynamic="true"
fitViewport="true">
<ui:include src="/resources/md.html" />
</p:dialog>
it works with no problem, but when I want to open the page in a specific anchor like this:
<p:dialog header="Dialog"
widgetVar="dlg"
resizable="false"
dynamic="true"
fitViewport="true">
<ui:include src="/resources/md.html#anchor" />
</p:dialog>
it doesn't work.
Can somebody help please.
Your attempt fails because your md.html is statically included inside 'parent' jsf page. Therefore only parent jsf page can be used to achieve 'go to anchor' functionality.
To achieve what you want with an included page inside p:dialog, I would use simple java script.
JS
Add this JS function to your parent jsf page (page where dialog is defined)
function gotoAnchor(anchorID) {
document.getElementById(anchorID).scrollIntoView();
}
XHTML
Add onShow attribute on p:dialog like this
<p:dialog ... onShow="gotoAnchor('anchorID')" ...>
<ui:include src="/resources/md.html" />
</p:dialog>
where anchorID is id of your anchor element inside md.html (in your example, its value is 'anchor').
On this way, when your p:dialog is shown, function gotoAnchor will be executed forcing page to scroll on required element.
This is another solution using iframe tag, it works perfectly:
<p:commandLink value="iframe" onclick="PF('dlg').show()" />
<p:dialog header="Dialog" widgetVar="dlg">
<iframe height="500" width="800" src="/md.xhtml#anchor"></iframe>
</p:dialog>
No js need.
I am using Xceed.Wpf.AvalonDock in my WPF application.
I want a feature on the start page of my application which gives users an option to change the theme of the application by a click of a button/link.
Any suggestions how to do this?
Currently, I am using following code in XAML to set the Aero theme:
<avalonDock:DockingManager.Theme>
<avalonDock:AeroTheme/>
</avalonDock:DockingManager.Theme>
You can add a combo box which contains theme names, also each item's Tag is filled with its associated theme name:
<ComboBox>
<ComboBoxItem Content="Generic" />
<ComboBoxItem Content="Aero">
<ComboBoxItem.Tag>
<xcad:AeroTheme />
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="VS2010">
<ComboBoxItem.Tag>
<xcad:VS2010Theme />
</ComboBoxItem.Tag>
</ComboBoxItem>
<ComboBoxItem Content="Metro">
<ComboBoxItem.Tag>
<xcad:MetroTheme />
</ComboBoxItem.Tag>
</ComboBoxItem>
</ComboBox>
Then these tag names in items are used for binding to the Theme property in DockingManager:
<xcad:DockingManager Theme="{Binding ElementName=_themeCombo, Path=selectedItem.Tag}">
You can set the theme fix like this:
<xcad:DockingManager Grid.Row="1" MaxHeight="425"
AllowMixedOrientation="True"
BorderBrush="Black"
BorderThickness="1"
>
<xcad:DockingManager.Theme>
<xcad:MetroTheme />
</xcad:DockingManager.Theme>
</xcad:DockingManager>
You should be able to do this with a binding like any other property:
<avalonDock:DockingManager Theme="{Binding ThemeProperty}">
...
</avalonDock:DockingManager>
And then in your code just make your button or whatever control you use change ThemeProperty
I created a style sheet theme named Basic. And Applied it to my web.config file. Then I created a class in the css file called Validator. I used cssClass attribute with the Validator type. The font-width is working but for some reason I can't get the color to change, it's stuck at red. I know the style sheet theme is working and the control because the font-width property corresponds when i makes changes, but the color text property isn't working.
Web.Config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<pages styleSheetTheme="Basic" />
</system.web>
</configuration>
ASPX Code:
<p id="validation">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
CssClass="validator" HeaderText="Please correct the following
errors:" />
</p>
Basic.css Code:
.validator{
color: Gray !important;
font-weight: bold;
}
Revised: Added code now works correctly and changes color to Gray.
you need to use class attribute instead of CssClass
<p id="validation">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
class="validator" HeaderText="Please correct the following
errors:" />
</p>
not sure if in asp it is used as CssClass since i never used ASP
I'm working on aspx pages and i have asp.net Menu and CSS assigned to it.
But when I run the application the CSS class names get changed and its dynamically created as we see in controls inside "ContentPlaceHolder".
The code is
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"
EnableViewState="False" IncludeStyleBlock="False" Orientation="Horizontal">
<DynamicItemTemplate>
<%# Eval("Text") %>
</DynamicItemTemplate>
<Items>
.
.
.
</Items>
</asp:Menu>
please check this Image what i get when i run this..
I checked my application to know whether the Menu control is placed inside content placeholder or anything. But its not.
Do anyone know how to solve this issue.
class="menu ct100..." means that this element has two classes 1:menu and 2:ct100...
and nothing is wrong with it!the ct100... is generated by asp.net and if it is different any time you run the page it's up to asp.net component and if you dont like that try not to use this built in component, that i think you should do it.
by the way the only thing is changing when using master pages is client side id, that you can avoid this from happening by code below
<asp:TextBox ID="myId" runat="server" ClientIDMode="Static"></asp:TextBox>
set ClientIDMode to Static
I have a problem using a Publishing HTML Field.
The Elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{987B9BA2-23AB-4E52-99DD-2D59BAA79F4B}" Name="LeftContent" DisplayName="Left Content" RichText="TRUE" RichTextMode="FullHtml" Type="HTML" Hidden="FALSE"></Field>
<!-- Parent ContentType: Article Page (0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D) -->
<ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D002da882f450a44abaacff86118ffffaeb"
Name="Left Content"
Version="0">
<FieldRefs>
<FieldRef ID="{987B9BA2-23AB-4E52-99DD-2D59BAA79F4B}"/>
</FieldRefs>
</ContentType>
</Elements>
In my Page Layout I use ...
<PublishingWebControls:RichHtmlField id="rchHtmlFldROSTableTwoColumnRight" FieldName="ROSTableTwoColumnRight" runat="server"/>
The problem is that when I create a page based on the page layout with this content type and edit the field, SharePoint saves the content not as HTML but HTML Entities. So in not-edit-mode you see the HTML source code like Hello World
I hope somebody can help me.
Thanks!! ;)
Try this snippet
<Field ID="0000000-0000-0000-0000-000000000000"
DisplayName="Sample Rich Text Field"
Name="SampleRichTextField"
StaticName="SampleRichTextField"
Group="Sample Fields"
Type="Note"
RichText="TRUE"
RichTextMode="FullHtml"
Sealed="FALSE"
SourceID="http://schemas.microsoft.com/sharepoint/v3" />
Try using Telerik's free RadMossHTMLEditor. The OOTB publishing HTML field does not have cross-browser support. The free control from Telerik works great for me. The controls is called RadEdtior Moss Lite.
Get it from here - http://www.telerik.com/account/downloads/product-versions/single-version.aspx?pmvid=0&pid=543
Dont forget to get the documentation too.
<Field ID="{987B9BA2-23AB-4E52-99DD-2D59BAA79F4B}"
Name="LeftContent"
DisplayName="Left Content"
RichText="TRUE"
**RichTextMode="ThemeHtml"**
Type="HTML"
Hidden="FALSE">
</Field>
Thats the solution!!!! ;)