Yii - link to a section of static page - yii

I am able to link to a static page like
CHtml::link('About Us',array('/site/page', 'view'=>'about'));
but how to link to a specific part of the static page, so that it renders
something like this
href="static_page.html#section"
I tried this and it doesn't work.
CHtml::link('Section',array('/site/page', 'view'=>'static_page#section'))

The right way would be CHtml::link('Section',array('/site/page', 'view'=>'static_page', '#'=>'section'))

Related

How to link to a custom template in Shopify?

I'm trying to add a link to a button in Shopify, but I can't get it to work.
I created a new template file in Templates called "page.alternate.liquid"
Then I try to link to it from header using this:
LINK
The output doesn't add any link at all, just a regular text.
To view an alternate template, you have two options:
1) On the resource in question, choose the template that the resource should default to using the selector on the right-hand side.
(Note: this only shows if you have at least 1 appropriate alternate theme in the live theme, and will only list the alternate templates in the currently-live theme)
2) When linking to the resource, add view=<template-suffix> to the querystring of the link.
Example: To link to an alternate page template templates/page.inverted_colours.liquid, your link URL would be /pages/about-us?view=inverted_colours
In your case in the question, that would look something like LINK
This article on Shopify partners blog might help as well: https://www.shopify.ca/partners/blog/shopify-alternate-templates
Hope this helps!

Auto configure page SEO of a module front controller on Prestashop

I added a ArtistsArtistsModuleFrontController on my artists module.
It's working perfectly but I add to go on the back office, section SEO & URL and edit module-artists-artists page to set Titles and URL (for each translations).
This is quite overkill and I would like my module to configure it automatically on installation.
Is this possible? How?
If you doesn't want to use database method, you can set directly meta title, meta description and meta keywords in your controller by set $this->context->smarty->tpl_vars['meta_title']->value
For custom url, you must use hookModuleRoutes : http://blog.belvg.com/how-to-generate-a-custom-url-in-prestashop.html

How to index Dynamic url page

I have a site that look like this:
Main page (index.php)
where a user can research a business.
To display result at page (search/index.php), the page url will look something like this:
/search/index.php?what=plumber&where=montreal&page=1
The page will generate dynamic link to access the business profile found. When you click on one of those links, you get here:
/entreprises/index.php?companyName=Something
How can I get the previous link to be indexed on Google?
This appears to be a good situation for the canonical URL tag. You'll want to specify a single URL for the page in question, and then other variations of that url getting to the same page (i.e. searches, tags, etc.) will refer to the stated canonical url as the actual url for SEO purposes.
Google has a detailed description of the tag here:
https://support.google.com/webmasters/answer/139394?hl=en

Liferay link-to-layout structure

I want to use inside a Liferay structure the link-to-layout field,
<dynamic-element name="linktopage" type="link_to_layout" index-type="" />
In the template I use href="$linktopage.getURL()"
the link is working properly but the page url is /web/12/13
I need to have a SEO url with the page name.
Anyone know how to do that using link-to-layout and velocity variable?
Tnx
Sabrina
instead of $linktopage.getURL(), try $linktopage.getFriendlyURL(), this should give you the url with page names instead of layout ids.

Easy static link for a Flattr thing

I would like to easily add a Flattr button to my RSS feed, without any JS
As I understand that each thing on flattr is identified by its URL, I would like to simply add a link like this:
http://flattr.com/thing-by-url/my-url.com/my-new-post
If the thing does not exist, it should be created the first time someone Flattr it (just like my blog does with JS)
From what I can read from the API, it is not currently possible and there's no way to add a static JS-less button in a RSS feed.
What can I do ? Why isn't it possible to have a direct static link ?
Why don't you use the http://developers.flattr.net/feed/?
You can also add a static button with auto submit URL in feed body.