I want to make a newsletter subscription box on home page in content area, and for that I have made a CMS page that other code I have placed in the newsletter subscription file can call too.
I am trying to call it like this:
<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
but it does not show up.
Why ?
system -> configuration -> advanced
from there enable newsletter module. and then you can use the above code to call it anywhere.
<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
If you look at the newsletter.xml layout update file, you will find the subscribe block defined like this:
<reference name="left">
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/>
</reference>
The easiest thing you can do is add something similar to the Layout Update XML for your homepage. Simply open the homepage in the CMS Pages area of the admin, click on the Design tab, and put this in the Layout Update XML text box:
<reference name="content">
<block type="newsletter/subscribe" name="home.newsletter" template="newsletter/subscribe.phtml"/>
</reference>
You may need to play around with it to get it to show up where you want, but that should work.
Related
I use yii2 framwork.
My set link style css with:
$this->registerCssFile command and set pages metatag in my controller.
But when page is load,link style and mettags Twice are load.
Plz see under link:
view-source:http://designtk.ir/
You either have loaded the header twice check your /layout.php for repeated
<?php $this->head() ?>
or you have registered the core scripts twice
Yii::app()->getClientScript()->registerCoreScript('jquery');
Yii::app()->getClientScript()->registerCoreScript('jquery-ui.min.js');
Yii::app()->getClientScript()->registerCoreScript('jquery-ui.min.css');
I have simple primefaces portlet, which is connected to the database. I have view (index.xhtml) with the table, which presents all my entries from db (I'm using p:dataTable). I have also a simple view (someView.xhtml), which shows specific information about one selected entry. When I click in the table one entry, browser loads someView.xhtml and page url looks like this:
somepage?p_auth=wRR1tGze&p_p_id=SomePortlet&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_SomePortlet__facesViewIdRender=%2Fviews%2Findex.xhtml
I need to create url which directly shows me page someView.xhtml and get custom parameter from url.
I'm using primefaces 3.5 and liferay 6.2 with bridge 3.2.4.
Thanks in advance.
Marcin
Liferay Faces Bridge has a Facelet implementation of the portlet: JSP tags.
Not sure if that's what you are asking for, but you can do a full page HTTP GET by putting something like this in your facelet view:
<ui:composition xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:portlet="http://java.sun.com/portlet_2_0">
<portlet:renderURL var="renderURL">
<portlet:param name="_jsfBridgeViewId" value="someView.xhtml" />
</portlet:renderURL>
<h:outputLink value="#{renderURL}" />
</ui:composition>
I have a ApplicationBarIconButton which I use repeatedly on multiple pages.
I want to be able to define the Click action in my Application C# file.
I have
<Application.Resources>
<shell:ApplicationBarIconButton
x:Key="AddLocationAppBarIconBut"
IconUri="/icons/appbar.add.rest.png"
Text="location"
Click="Add_Location_Event" />
in my App.xaml file and I want to load it into another page I have under
<phone:PhoneApplicationPage.ApplicationBar>
How do I go about this exactly?
Can I bind a click event to an event in my Application cs file?
Unfortunately, you can't!
In full WPF framework, you'd be able to do something like this:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar>
<shell:ApplicationBar.Buttons>
<StaticResource ResourceKey="AddLocationAppBarIconBut" />
</shell:ApplicationBar.Buttons>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
The trick here is in the usage of StaticResource, but Silverlight doesn't have a backing class representation like that; you can only use the Markup Extension as {StaticResource AddLocationAppBarIconBut}, but this won't help you here!
What you can is define the full ApplicationBar object as a resource and then just call it on the page like this:
<phone:PhoneApplicationPage ApplicationBar="{StaticResource ApplicationBarResource}">
<!-- remaining code -->
<phone:PhoneApplicationPage />
I'm attempting to add a button to the Activities grid ribbon to open a modal window that shows all the activities with latlng data on a map.
I have this working ok for a small number of activities, but once the selected number grows too large CRM has problems opening the modal window.
My current theory is that this is because the parameter string is too long to be passed via the GET method.
Is there a way to pass the SelectedControlSelectedItemIds to the web resource using POST rather than GET? I can't see any in TN docs*, but I'm hoping someone might have found a way.
*http://technet.microsoft.com/en-us/library/gg309332.aspx
Here's a snippet of the code I have at the moment:
<CommandDefinition Id="Mscrm.Isv.activitypointer.HomepageGrid.Group0.Control0">
<EnableRules>
<EnableRule Id="Mscrm.Enabled" />
</EnableRules>
<DisplayRules />
<Actions>
<Url Address="$webresource:as_cam_mapsa" WinMode="1" PassParams="true" WinParams="dialogHeight: 800px; dialogWidth: 1000px">
<CrmParameter Name="data" Value="SelectedControlSelectedItemIds" />
</Url>
</Actions>
</CommandDefinition>
Instead of using a html webresource, you could could call a javascript function with no parameters from the ribbon. Inside this javascript you can use something like this to get the selected ids:
document.getElementById("crmGrid").control.get_selectedIds();
Now you can select if you want to use javascript / jQuery or another framework to build the whole dialog - or you can use showModalDialog in javascript to get the same dialog as crm uses. In any term you now have a litle bit more control on how the parameters are sendt.
You should also be able to use the code above inside your html webresources javascript by getting the parent window from dialogArguments that is sent by default to a modal dialog.
window.dialogArguments.window.document.getElementById("crmGrid").control.get_selectedIds();
I want to remove the right panel from my category page. In fact I could do it manually while creating a category and select 2 page layout there. But Since I have a long list of categories And I Dont Need the right panel anyway. So i would like to remove it permanently from my category page. Is there any simple way using Xml or Phtml I can Achieve this.
Open Your catalog.xml file
Find <catalog_category_default translate="label"> Tag Around Line number 76
JUst go to the above xml tag and then add this code it will set the default template to 1columt
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>