Recently viewed products block at bottom of products list page -magento - magento-1.5

I would like to display recently viewed products block at bottom of page in Product list page (out of left, content and right block) . It must display from left to right side of page ,i search in many forums but i'm not getting right answer can any one help me please

Would you like to show it on 'Product View Page', if yes, then you can change the xml file like this, comment out the bit which display it on right and write this (Assuming ur using Magento's latest 1.6.x versions,)
<catalog_product_view translate="label">
<reference name="content">
<block type="reports/product_viewed" name="right.reports.product.viewed" as="recently_viewed" template="reports/product_viewed.phtml" />
</reference>
</catalog_product_view>
This should display the 'Recently Viewed Products' on your product page in the main content area.

Related

Liferay 7.4: How to create a configurable web content article footer?

I need to create a footer in a Liferay-project, that can be modified from the instance. I've been trying various things in my footer-code and instance, but haven't figured out how to do it.
Any content inside the footer can't be touched and in page edit mode, Liferay says "This area is defined by the theme. You can change the theme settings by clicking more in the Page Design Options panel on the sidebar". I didn't get any help from Page Design Options either. Is there a way to do this?
I found the answer after hours of work and searching and want to share it with everyone here. The working solution was found here, in one of the comments.
You need to write some code (I use Freemarker/ftl) and then configure the site pages a bit, but here's how it works:
Put a new setting inside liferay-look-and-feel.xml:
<settings>
<setting key="footer-article-id" value="" configurable="true" type="text"/>
</settings>
This will create a new configurable option in page options, allowing you to input the ID of the web content.
NOTE: <theme> might get underlined red "The content of element type "theme" must match". This still prints everything correctly, but the tags are given in a wrong order. Inside my <theme>, I have <template-extension>, <settings> and <portlet-decorator> in that order, which removes the error.
Assign a variable in init_custom.ftl (cleans up the footer-code):
<#assign footer_article_id = getterUtil.getString(themeDisplay.getThemeSetting("footer-article-id"))/>
And then add this to the footer-code, to create the spot, where the content is visible:
<#liferay_journal["journal-article"]
articleId=footer_article_id
groupId=page_group.groupId
/>
After this, everything should be ready code-wise.
Create a Web Content for your footer. In the creation screen, there's an ID on the panel on the right. Publish your content and grab the ID.
Finally, go to Site Builder --> Pages and click on configuration from the top bar (behind three dots). You should see the input field like in the first picture: That's where you add the ID.
Save the settings and your web content should now be in the footer.
Hope this helps!

Optimize Visualforce Page for Salesforce1

I created a simple visualforce page to override the standard salesforce.com page for "New" and "Edit" for a Custom Object.
It is pretty simple, it was just because in the standard salesforce.com page the textarea was not wide enough, since the form is splitted in two columns. (Or am I wrong? Is there a way to accomplish that without creating a custom visualforce page?)
Well, here is the code:
<apex:page standardController="Object__c">
<apex:sectionHeader title="Object Edit" subtitle="{!if(Object__c.id==null,'New Object',Object__c.Name)}"/>
<apex:form >
<apex:pageBlock title="Object Edit" mode="edit">
<apex:pageblockbuttons >
<apex:commandbutton action="{!save}" value="Save"/>
<apex:commandbutton action="{!cancel}" value="Cancel"/>
</apex:pageblockbuttons>
<apex:pagemessages />
<apex:pageblockSection title="Basics" columns="2">
<apex:inputField value="{!Object__c.Field1__c}"/>
... more fields
</apex:pageblockSection>
<apex:pageblocksection title="Details" columns="1">
<apex:inputField value="{!Object__c.Field10__c}"/>
... more fields
</apex:pageblocksection>
</apex:pageBlock>
</apex:form>
</apex:page>
Ok, the page looks good on force.com, but when I open it from within the salesforce1-App on my iPad it has the same style like on force.com and not the nice styling like the other (standard salesforce.com page-)forms in the salesforce1-App?
To get the styling right, consider using the Mobile Design Templates: https://developer.salesforce.com/en/mobile/services/mobile-templates/templates-faq.
I think you would also benefit from reviewing this slide deck: http://www.slideshare.net/developerforce/visualforce-in-salesforce1-1-1. It specifically asks developers to avoid using pageBlocks in Salesforce1. The author of those slides is Sandeep Bhanot, who, in general, is a great person to connect to on Twitter/Youtube, etc, for all your Salesforce1 needs.
You can have textarea span 2 columns in std page layout by putting it to separate section and setting columns to 1. Just hover over the section header, click the wrench icon on the right and you should get a popup like this:
I'd say for such change it's bit of an overkill to go full VF page route. But if you really need it or my trick won't work - there are few questions on Salesforce-dedicated site that might be a good start for you:
https://salesforce.stackexchange.com/questions/22290/sfdc-styleguide-usage-questions-in-salesforce1
https://salesforce.stackexchange.com/questions/25541/salesforce1-look-feel-in-visualforce
https://salesforce.stackexchange.com/questions/27788/how-to-do-visualforce-page-with-the-same-look-feel-as-salesforce1
https://salesforce.stackexchange.com/questions/37111/mobile-view-one-one-app-differs-from-native-salesforce1-view (not really related but it's my answer so :P Seriously though - the presentations I've linked to in that answer really helped me to kick off my development)

Magento Content Block Question

Noob Question here. I have created and successfully added an additional Page Layout to the existing theme on a client's website.
I then checked what was going on in the content area and found that a file, named grouped.phtml was being called.
The Problem:
I want to duplicate that file and call it (for example) grouped2.phtml and add it to my custom page layout, while keeping the first file (grouped.phtml) alone. How do I do this? Thank you ahead of time.
Copy grouped.phtml from base/default/template/catalog/product/view/type/ to grouped2.phtml in the same directory of your theme. Edit it as you wish.
Open up layout/catalog.xml in your theme. Find the lines that say
<block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
</block>
Duplicate those lines with your grouped2.phtml
done.
======EDIT===========
If you wish to retain the standard grouped.phtml as the default, but use your grouped2.phtml in some specific instances, you can make XML layout changes in the "Custom Layout Update" field on the Design tab of the specific products or categories in the Magento Admin. In that case, use the following XML:
<remove name="product.info.grouped"/>
<block type="catalog/product_view_type_grouped" name="product.info.alternative.grouped" as="product_type_data" template="catalog/product/view/type/grouped2.phtml">
<block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
</block>
Note that the inserted XML has a different name.

Create a Sharepoint page but don't show in breadcrumb

I'm struggling to do something which I thought should be straight forward, basically I need to create an aspx page which I now realise must be put into a document library but the problem I have is it's only one page and when the page is displayed the breadcrumb has a link to the document library.
We really don't want the users to be able to get to the library via the breadcrumb and just want to show the page. From one of my other questions some other helpful people made some suggestions like putting the file in the _layout directory but this won't work because the new page has a master page associated with it.
Any ideas how I can display the custom page but not allow normal users to navigate to the document list?
Thanks!
Dan
Having a master page associated with an ASPX page does not prevent it from being placed in the _layouts directory. All of my ASPX pages use a custom master page I wrote, and they're all stored in the _layouts directory. But there's enough methods to hide the breadcrumbs without changing the storage location.
If you want to hide the breadcrumbs on only a specific page, the simplest method to do so is to prevent the contents of the breadcrumbs from being displayed. On the default master page (and I'm going assume that your master page also has this), there is a content called "PlaceHolderTitleBreadcrumb", which is what displays the breadcrumb. By overriding this in the ASPX file, you can prevent this from displaying. A simple way is to just insert the following line in your ASPX file:
<asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server"> </asp:Content>
By being in the page itself, it becomes a custom version of the breadcrumb instead of the master page's, so it won't evaluate itself and will leave you with a blank line. The will keep content inside the table cell, so it will specifically make a blank line occupy the same space that the breadcrumbs normally would. If you just put an empty content there, then it will instead render nothing there and pull all of your content upwards. Up to you if you think that looks better.
As far as where to place the line, I recommend just beneath the following lines, if your ASPX page has them. If you don't have the following lines, you might have to experiment a bit to find what position works properly.
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
<IMG SRC="/_layouts/images/blank.gif" width=1 height=1 alt="">
</asp:Content>

Faulty pages created by SiteDefinition

I'm creating some pages using a SiteDefinition, the markup looks something like this:
<File Url="Page.aspx" Name="$Resources:SiteDefinitions,PageName;" Type="GhostableInLibrary">
<Property Name="Title" Value="$Resources:SiteDefinitions,PageTitle;" />
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Somepage.aspx"></Property>
<AllUsersWebPart WebPartZoneID="WebPartZone1" WebPartOrder="1">
-- webpart data here
</AllUsersWebPart>
</File>
The page is created as expected, but it's somewhat faulty. If for instance I click Edit Page and then click Publish (without actually editing anything) I will get this error:
"This Page has been modified since you opened it. You must open the page again."
I will get this error approx. every second time I try an editing action.
If I manually create a page using the same page layout everything works as expected and this error does not show up.
Does anybody have an idea what could be wrong?
I too create a Page using the above method only thing I found missing in your code is that I used to have a title in the PageLayout as
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Somepage.aspx, Your title"></Property>
This should not be the cause, but you can try it, Also refer the articles this or this
I think you're right with using PublishingLayoutPage. I came across this article today while searching for this error caused by something else. It describes your same issue although the person in the article was not inheriting from PublishingLayoutPage and had not specified the PublishingPageLayout property. When they fixed this it worked.
This doesn't directly help you, although I did notice in their article that they are specifying the ContentType property. Have you tried specifying this? As you can see your complete code, are there any other differences you see from the article or additional information from the comments?
Okay, I (kinda) got this working now.
The guy who had made the ONET.xml had put a reference to the page layout in the Url attribute of the element.
Like I wrote in a comment earlier I tried making the page layouts inherit from TemplateRedirectionPage. Instead I now made an empty default.aspx file that inherits from TemplateRedirectionPage and changed all my page layout files back to deriving from the PublishingLayoutPage. And then I added the PublishingPageLayout element below every element.
Funny, or oddly, having a refence to the page layout in the Url attribute and not having the PublishingPageLayout element at all is actually valid. It doesn't make sense, because it will produce these faulty pages, but SharePoint actually accepts it and spits out all the pages defined in the ONET.xml
Only thing left now is that since I made the above changes, when I manually create a new page based on a page layout every default webpart (as defined with AllUsersWebPart) is instantiated 5 times. Really don't know where this behaviour is coming from, but at least it's not as serious as not being able to edit/publish my pages :)

Resources