public function getCMSLink($cms, $alias = null, $ssl = null, $id_lang = null, $id_shop = null, $relative_protocol = false){ if (!$id_lang) { $id_lang = Context::getContext()->language->id; } $url = $this->getBaseLink($id_shop, $ssl, $relative_protocol).$this->getLangLink($id_lang, null, $id_shop); $dispatcher = Dispatcher::getInstance(); if (!is_object($cms)) { if ($alias !== null && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_title', $id_shop)) { return $url.$dispatcher->createUrl('cms_rule', $id_lang, array('id' => (int)$cms, 'rewrite' => (string)$alias), $this->allow, '', $id_shop); } $cms = new CMS($cms, $id_lang); } // Set available keywords $params = array(); $params['id'] = $cms->id; $params['rewrite'] = (!$alias) ? (is_array($cms->link_rewrite) ? $cms->link_rewrite[(int)$id_lang] : $cms->link_rewrite) : $alias; $category = new CMSCategory($cms->id_cms_category); //Custom code to […]
An Introduction to the `fr` CSS unit
fr typography An Introduction to the `fr` CSS unit Robin Rendle on Jun 12, 2017 (Updated on Aug 17, 2022) DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit! With all the excitement around CSS Grid, I haven’t seen as much talk about the new fr CSS length unit (here’s the spec). And now that browser support is rapidly improving for this feature, I think this is the time to explore how it can be used in conjunction with our fancy new layout engine because there are a number of benefits when using […]
6 CSS snippets every front-end developer should know in 2023
Home All articles 6 CSS snippets every front-end developer should know in 2023Toolbelt worthy, powerful, and stable CSS you can use today.Mar 15, 2023 Adam Argyle TwitterGitHubGlitchHomepageOn this page 1. A container query2. Scroll snap3. Grid pile4. Quick circle5. Control variants with @layer6. Memorize less and reach more with logical propertiesI believe every front-end developer should know how to use container queries, create a scroll snap experience, avoid position: absolute with grid, swiftly hammer out a circle, use cascade layers, and reach more with less via logical properties. Here's a quick overview of each of those expectations.1. A container query […]
BEM Front-End Methodology
Introduction to BEM In web development, especially for smaller sites, organizing CSS styles may seem trivial. However, as projects scale and become more complex, effective CSS organization becomes crucial. It not only influences the speed of development but also impacts the maintainability of code and the overall performance of web applications. This challenge is exacerbated in larger teams where collaboration is key and in long-term projects that might involve legacy code. To address these concerns, various methodologies have emerged, with BEM (Block, Element, Modifier) being one of the most effective for maintaining clarity and structure in CSS. Methodologies in CSS […]
Prestahop Admin Login Page — header.tpl
For those of you who are just looking to copy/paste click on the the complete code or scroll to the bottom of the article...whichever is faster o_O So here is the problem, currently I'm running Prestashop 1.6.1.6 in one of my client's websites and they ask me to make some modifications to the login admin page. The login admin page is the one we use to login to the back-end of your Prestashop installation. So in my mind, this was easy all I need to do was to find the login admin template override it and apply the needed modifications; yes […]
Cycloramic
This app takes hands-free 360-degree panoramic photos. To do this, the app depends on the iPhone 5’s flat ends to stand up. Vibrations created by the haptic engine rotate the device, while the camera captures the surrounding environment. The result is a perfect panoramic photo. https://www.youtube.com/watch?v=_uKkqVKQIbY Even more innovative is Cycloramic’s solution for the round-edged iPhone 6, which cannot stand on its end. The app’s creators use an additional material, the charging plug, as a holder for the phone. Good apps leverage the technologies made available by the device that they’re designed for. The new Apple Watch could lead to […]
Foundation Zurb and the WordPress Comment Summit Button
For the last couple of weeks, I have been working on a theme using WordPress, Genesis and Foundation Zurb. Foundation is a front-end framework for rapid prototyping. Meaning? It is a large array of tools that make most of look that much cooler and way faster to code. However, mixing these 3 awesome tools into one single project didn't come without its headaches. One of the major problems I have encountered so far is to be able to match preexisting CSS styles in Foundation with WordPress. I could go about it in in two different ways. First, by using WordPress filters which will […]
EMMET Plugin – “Lorem Ipsum” Generator
This little plugin that I'm currently using along with my Sublime Text editor for Window is called EMMET. It has cut in half the amount time it takes me to code HTML & CSS. It comes with a large number of coding features and shortcuts but when you combine that with a "Lorem Ipsum" generator, it makes this a great design tool. I could spend several articles explaining in detail all of EMMET's features so I'm just going to focus on the "Lorem Ipsum" Generator. What is "Lorem Ipsum?" Chances are that if you are a web developer, you are already […]
Parsing html as PHP Using Apache
You could add the following code to your Apache config file inside of <IfModule mime_module> tag: AddType application/x-httpd-php5 .html .htm If you need to support other file types, like "..xml", simply add them to the list, like this: AddType application/x-httpd-php5 .html.xml The entire text should look like this. <IfModule mime_module> AddType application/x-httpd-php .php </IfModule> Also, you could add the same line of code, anywhere inside your .htaccess file. […]
Old Virtual Host Configuration Access Forbidden Error 403 (XAMPP)
This was frustrating until I realized some of the configuration options I have been using for so long when configuring a virtual host in my local machine have been deprecated. Adding one line of code did the trick - Require all granted This is what I used to use: <Directory "/websites/httpdocs/dummmy-website"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> And this is what I'm using now. <Directory "/websites/httpdocs/eOpiates/website-dynamic/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> […]
Apache Module mod_rewrite
Some things to remember when working with Apache module mod_rewrite and dynamic websites: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> '<CondPattern' (lexicographically precedes) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString lexicographically precedes CondPattern. '>CondPattern' (lexicographically follows) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString lexicographically follows CondPattern. '=CondPattern' (lexicographically equal) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString is lexicographically equal to CondPattern (the two strings are exactly equal, character for character). If CondPattern is "" (two quotation marks) this compares TestString to the empty string. […]