amnesiak Posted November 19, 2014 Share Posted November 19, 2014 Hi, I would like to add a direct link in CMS block, to take me to a product category page. Is it possible? Im using version 1.4.4.1 Link to comment Share on other sites More sharing options...
PascalVG Posted November 21, 2014 Share Posted November 21, 2014 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 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. It will open the CMS page for a moment (with the message "One moment, you will be redirected..." 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now