Jump to content

Add a link to CMS block pointing to product category


Recommended Posts

If you don't mind that the CMS page loads for a second, before it redirects, you can do this:

 

Edit classes/CMS.php   (Make backup!!)

 

You see the following code:

class CMSCore extends ObjectModel
{
   public $meta_title;
   public $meta_description;
   public $meta_keywords;
   public $content;
   public $link_rewrite;
   public $id_cms_category;
   public $position;
   public $active;
 
   protected $fieldsValidate = array('id_cms_category' => 'isUnsignedInt');
   protected $fieldsRequiredLang = array('meta_title', 'link_rewrite');
   protected $fieldsSizeLang = array('meta_description' => 255, 'meta_keywords' => 255, 'meta_title' => 128, 'link_rewrite' => 128, 'content' => 3999999999999);
   protected $fieldsValidateLang = array('meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'content' => 'isCleanHTML');
...
 
Change the last line of this code block into the red code:
 
   protected $fieldsValidateLang = array('meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'meta_title' => 'isGenericName', 'link_rewrite' => 'isLinkRewrite', 'content' => 'isAnything');
 

and save.

 

Then, create a new CMS Page.

 

At the contents of the CMS page, click the 'HTML' button

post-455771-0-61925200-1416598260_thumb.png

 

 

and in the pop up, copy this piece of code:

 

 

One Moment, you will be redirected...
<script type="text/javascript">// <![CDATA[
function Redirect(url)
{
 location.href = url;
}

Redirect ("http://www.phelineonline.com");
// ]]></script>

(N.B. If you don't want to link to my site, just change the URL ;-)   )

 

Save the page, add the new CMS page to the CMS Block footer or in CMS Block in left/right column) (using modules->modules, CMS block - configuration page)

 

reload the front page and click the new CMS link.

 

post-455771-0-91760300-1416598284_thumb.png

 

 

It will open the CMS page for a moment (with the message "One moment, you will be redirected..."

post-455771-0-28627000-1416598300_thumb.png

 

 

and after a short moment, you will be redirected to the page you linked to.

 

 

That should do it...

 

pascal

 

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...