How to remove magento's categories sidebar navigation? - magento-1.9.1

I want to remove the category listing in the category view from my magento site. I got the top menu and the sidebar one is redundant.

This was dispaly in left sidebar using this code
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/left_nav.phtml" />
</reference>
So remove using local.xml
<default>
<reference name="left">
<remove name="catalog.leftnav">
</reference>
</default>
Or then add catalog/layer_view block where you want to, but change the name
<block type="catalog/layer_view" name="yourname.catalog.leftnav" template="catalog/layer/view.phtml"/>

Related

Sitecore web indexing issue for more version items in master database?

When a new version of an item is created in master database, if we edit the item and save and publish it.The item gets published and web database contains the latest updated version item. But while browsing item is not visible on the website
some $name is visible for the item.
Sometimes the item is not visible and sometimes it is visible with $name.
Also when browsing the item directly through url item is visible with latest updated content,so the item is published.Its seems some problem related with indexing.
But when an item is directly edited without the creating a new version,then the issue doesn't exist.So the issue is with the indexing as well as versions as I guess there will be more than one latest versions for the web index which is creating the problem.
How to fix this issue? As a workaround I have to delete the item from web database and republish and rebuild the index again to solve the issue.
Is there a need to customize the existing indexing and crawler strategy for more than one versions of items?If so which files needs to customize or override and change?"
Here is the code snippet for web indexing for the data items to be displayed?
<!-- sitecore_web_content_mag_index -->
<indexes hint="list:AddIndex">
<index id="sitecore_web_content_mag_index" type="Sitecore.ContentSearch.LuceneProvider.SwitchOnRebuildLuceneIndex, Sitecore.ContentSearch.LuceneProvider">
<param desc="name">$(id)</param>
<param desc="folder">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
<commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
<policies hint="list:AddcommitPolicy">
<policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
</policies>
</commitPolicyExecutor>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Site/Home</Root>
</crawler>
</locations>
</index>
</indexes>
When using the ContentSearch API, you can filter the results to return only the latest version by doing something like this:
searchContext.GetQueryable<SearchResultItem>()
.Where(result => result["_latestversion"].Equals("1");
Or, if you have created your own search result model, you can add a property to it to make the query syntax more consise.
Search Result Model:
public class CustomSearchResultItem : SearchResultItem
{
[IndexField("_latestversion")]
public bool IsLatestVersion { get; set; }
// other properties
}
Query
searchContext.GetQueryable<CustomSearchResultItem>()
.Where(result => result.IsLatestVersion);
Another approach is to use extension methods as described in this post: http://laubplusco.net/generic-extension-methods-sitecore-contentsearch/

Virtocommerce new filter does not appear

Virtocommerce has default filter for Brands, Color, etc.
I need implement a new filter called IDConcurso. This field (IDConcurso) is registered like a property of item.
I inserted the code bellow in table StoreSetting to XML column of row named "FilteredBrowsing":
<attribute key="IDConcurso" localized="false">
<simple id="Test1" value="1" />
<simple id="Test2" value="2" />
<simple id="Test3" value="3" />
</attribute>
I also added the property called IDConcurso in all items. But this filter never appear on the left side. What do I need to do more?
Do I need to change any code for filtering items by property called IDConcurso? Or I need just pass by QueryString ..../?f_idconcurso=1 ?
The filter will only appear if there are product that have those properties. If products do have those properties then you also might need to to rebuild the index.
Simply open Commerce Manager and go to the settings->search and click re-build index button.

How do I access list items metadata, but maintain the list?

I have created a custom .targets file with following item group
<ItemGroup>
<AvailableItemName Include="Foo" />
</ItemGroup>
I can access that collection or list with #(Foo) and I get 'Item1.txt;Item2.txt'
If I do %(Foo.FullPath) I get 'C:\projectfolder\Item1.txt'
How do I use both the meta data tag %, and the "collection" tag # together to get
'C:\projectfolder\Item1.txt;C:\projectfolder\subfolder\Item2.txt' ?
#(Foo->'%(Foo.FullPath)')
You can read more MSBuild Transforms

Can Msbuild dynamically generate a list of Item.Metadata?

<SqlToMetadataMultiTask ConnectionString="$(ConnectionString)">
<Output TaskParameter="Items" ItemName="MultiStats" />
<Output TaskParameter="Columns" ItemName="MultiColumns" />
</SqlToMetadataMultiTask>
<PropertyGroup>
<OutputFormat>#(MultiColumns,',')</OutputFormat>
</PropertyGroup>
<Message Text="Columns=#(MultiColumns,',')"/>
<WriteLinesToFile File="SqlMetricsMulti.csv" Overwrite="true" Lines="#(MultiColumns,',')" />
<WriteLinesToFile File="SqlMetricsMulti.csv" Overwrite="false"
Lines="#(MultiStats->'%(db),%(num_procs),%(len_procs),%(cursors_refs),%(tt_refs),%(ifs),%(cases),%(where),%(join),%(ands),%(ors)')" />
I have a row for each database, and write out the column headers, then the metadata-stored metrics for each database.
Can I make this task more generic so that the data output columns are generated dynamically just like the Column headers are being done? In some ways this would be custom metadata whitelisting by another item group dynamically based on the input.
See this answer in the link below, which is somewhat similar, writing out item meta data to a file. You'll need to check out the docs for ITaskItem, specifically ITaskItem.CloneCustomMetadata to get the generic behavior you're looking for.
Passing Items to MSBuild Task

Does the Wikipedia API support searches for a specific template?

Is it possible to query the Wikipedia API for articles that contain a specific template? The documentation does not describe any action that would filter search results to pages that contain a template. Specifically, I am after pages that contain Template:Persondata. After that, I am hoping to be able to retrieve just that specific template in order to populate genealogy data for the openancestry.org project.
The query below shows that the Albert Einstein page contains the Persondata Template, but it doesn't return the contents of the template, and I don't know how to get a list of page titles that contain the template.
http://en.wikipedia.org/w/api.php?action=query&prop=templates&titles=Albert%20Einstein&tlcontinue=736|10|ParmPart
Returns:
<api>
<query>
<pages>
<page pageid="736" ns="0" title="Albert Einstein">
<templates>
...
<tl ns="10" title="Template:Persondata"/>
...
</templates>
</page>
</pages>
</query>
<query-continue>
<templates tlcontinue="736|10|Reflist"/>
</query-continue>
</api>
I suspect that I can't get what I need from the API, but I'm hoping I'm wrong and that someone has already blazed a trail down this path.
You can use the embeddedin query to find all pages that include the template:
curl 'http://en.wikipedia.org/w/api.php?action=query&list=embeddedin&eititle=Template:Persondata&eilimit=5&format=xml'
Which gets you:
<?xml version="1.0"?>
<api>
<query>
<embeddedin>
<ei pageid="307" ns="0" title="Abraham Lincoln" />
<ei pageid="308" ns="0" title="Aristotle" />
<ei pageid="339" ns="0" title="Ayn Rand" />
<ei pageid="340" ns="0" title="Alain Connes" />
<ei pageid="344" ns="0" title="Allan Dwan" />
</embeddedin>
</query>
<query-continue>
<embeddedin eicontinue="10|Persondata|595" />
</query-continue>
</api>
See full docs at mediawiki.org.
Edit Use embeddedin query instead of backlinks (which doesn't cover template inclusions)
Using embeddedin does not allow you to search for a specific person, the search string becomes the Template:Persondata.
The best way I've found to get only people from Wikipedia is to use list=search and filter the search using AND"Born"AND"Occupation":
http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch="Tom Cruise"AND"Born"AND"Occupation"&format=jsonfm&srprop=snippet&srlimit=50`
Remember that Wikipedia is using a search engine that doesn't yet allow us to search only the title, it will search the full text. You can take advantage of that to get more precise results.
The accepted answer explains how to list pages using a certain template, but if you need to search for pages using the template, you can with the hastemplate: search keyword: https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=hastemplate:NPOV%20physics