switch store view with href - magento

I'm trying to switch magento store views by url/href.
I created a default store view, with a cms where a block gets loaded
which contains a landing page where you should choose your language. After
it is chosen it appends the language code to the url and sets a cookie.
I created a second store view, with the base url http://myshop.dev/en/.
So if the user has chosen "England" he gets redirected to http://myshop.dev/en/, but the
english shop doesn't get called.
Instead the message appears "There was no 404 CMS page configured or found."
I'm quite new to magento.

Not very well worded, but sounds like you just want to create a store switcher drop down.
If so, have a look in app/design/frontend/base/default/template/page/switch/languages.phtml for an example.

Related

Strapi Bundle/Group Collection-Types

Is it possible to bundle up collection-types in Strapi?
What I mean by this:
For example, our website has a Media&Downloads page. This page consists of several categories (Logos, Poster, Press-Releases etc.)
All of these categories are reflected as own collection-type inside Strapi.
Now one request of the editors' is, that they want all these collection-types regarding certain pages bundled up. Inside Strapi, you would then on the collection-type navigation(left side) only have the "Press & Media" type, and when you click on it, it acts like an accordion and all the real collection-types are being displayed.

How to display for static block pages for magento1.9.0.1?

i created staticblock pages in admin panel(magento ver1.9.0.1),but while creating pages the storeview tab is missing..so,i'm unable to create a layout for my staticblock pages.please check the image below:
If you have single store, then it will not asking for store view.
which error message you got while saving static blocks ?
Answer :
1. Add CMS Block with Banner
- http://www.awesomescreenshot.com/image/2010900/2819f42368db4893663d47c2a54d9b51
Add layout update for banner
Find home page in CMS pages Section
"Design" Tab
Layout Update XML
banner-static-block-identifier
Save It.
{{THEME PATH}}/template/page/html/header.phtml
Add this line where you want.
getChildHtml('banner-static-block-identifier') ?>
If you have only one website with single store or storeview then it will not be display.
Please first create at least one extra store.

Is it possible to identify file name passing url in magento?

How to identify coding having this file at magento .
For example,
Link Mean
how to identify which file its denotes ?
http://localhost/index.php/about-magento-demo-store/ is not a file, it's CMS page content which is actually a row stored in the cms_page table in your database that gets filtered through a template to produce html page content that is pushed to your browser.
Look under the CMS=>Pages menu, you'll find a grid and if you search in the url key column for about-magento-demo-store, you can find the page content there.
Magento's content does not exist as static pages, it is data stored in the database that gets selected, filtered through templates and assembled into HTML that gets final styling from CSS. It only becomes a page, once it is downloaded by the web browser.
1)Url redirects
look at the core_url_rewrite table and find the url that you requested.
if you find it, and target path starts like catalog/category/view/id/5,
that means catalog module, category controller, view action which you can find in
app/code/core/Mage/Catalog/controllers/CategoryController.php the method is viewAction.
2)Cms Pages
it can be a cms page
3)One of modules controller
It is the best way to install a profiler and see which controller handles your request.

how to use the facebook like button with ajax driven content and load dynamic content

I have searched the net for a solution but can't seem to get anywhere.
My page (php) is loading with one url (let's say www.mysite.com)
in the page several search options on music (albums) can be done and the tracks are shown. (without refreshing the page). the info comes from a database.
So the url stays the same.
In this search process the facebook meta tags (description, url, title) stay the same also because I never reload the page, I only load content into div's.
I would like to be able to 'like' the album, and backlink to it. So I have created the function to load the album by using the url: www.mysite.com?album=12345
I can show a popup with this url to share this.
So, if you go to this url, the content is automatically loaded based on the url parameter.
And on this spot (where you can see the url with the parameter ?album=12345) I would like to show the 'like' button as well. (I generated the url, so I use this in the code:)
echo '<div style="overflow:visable" class="fb-like" data-href="http://mysite.com/?album='.$albumid.'" data-send="false" data-width="300" data-show-faces="false">?</div>';
it works so far... (after I added the parse code to enable the button)
However the like button takes the default meta tags description and title etc.
Not particular on this album or artist - so it's not unique.
Note: if I remove the meta[property=og:url] from the header I can make the button backlink to the right url with the ?album parameter. Otherwise it would go back to the default root of the site mysite.com (this does make the lint tool give an error on the missing meta)
I have tried to add into this same function something like:
$("meta[property=og\\:url]").attr("content", "http://mysite.com/?album=<?php echo $albumid; ?>");
$("meta[property=og\\:title]").attr("content", "<?php echo $artistname; ?>");
$("meta[property=og\\:description]").attr("content", "<?php echo $albumname; ?>");
I did this so the meta tags will be changed, just to let the like button show the right description etc. However this doesn't work.
I understand that facebook scrapes the page (I used the lint tool etc.) but I will never executes javascript, so the meta tags wil stay as default (when first loading the page)
What can I do to make a unique like button, with it's own description (albumname etc) without making a html page for each one of them (millions of albums in the database...)
I hope it makes sense.
I can't seem to figure this one out, help please :-)
Based on the comments below I used the following solution:
you should create the right fb meta tags when the url (with the params ?alb_id=12345) is opened.
That's enough for the like button to do its job.
Your logic is fine, up to the point where you're setting the meta tags using jquery.
They should be set using PHP. As you can imagine the scraper won't execute the jquery, but if it's fed the already PHP-customized meta tags it will use them (as provided).
Just have the og:tags prepared server-side, depending on the albumId requested, and it should work. It might not work right away, I remember there used to be occasional caching issues with the scraper before.
In short, index.php?album=123 will send a different set of og:tags to the scraper than say index.php?album=321. Just set them up server-side.
<meta property="og:title" content="<?php echo $artistTitle; ?>"/>
What can I do to make a unique like button, with it's own description (albumname etc) without making a html page for each one of them (millions of albums in the database...)
You can’t, because Open Graph objects are URLs (resp. are represented/identified by their URL).
One URL == one Open Graph object.
But where’s the problem in having one URL for each album? Since it all works using parameters, it’s not like you have to create a page for each album URL manually …

Why is my menu item resulting in a file not found error in Joomla?

I have a new component called com_location. It has a single model,
controller, and view. If I go to the page URL manually (i.e.
mysite.com/index.php?option=com_location&view=location) it displays my
view correctly (all the view does right now is display a table
containing a bunch of records from the database.)
However, when I add a menu item of type Internal Link, it doesn't
work. I select Internal Link, then Locations -> Location - >Default
Layout (my only choice.) I set the title to Find a Community, and the
alias to find-a-community. The generated link shown in the Link input
field (non-editable) is index.php?option=com_location&view=location -
exactly the same URL I can type in manually.
When I go to my front-end, the Find a Community link is there;
clicking on it produces the URL mysite.com/find-a-community, and
instead of my component, I get an error message: "The requested URL /
find-a-community was not found on this server."
I do have search engine-friendly URLs enabled in the global
configuration.
Help?!
If you disable SEF urls does it work? If so, you will need to write a router.php file
http://docs.joomla.org/Routing

Resources