Monday 12 December 2011

SilverStripe - Adding Checkbox to CMS

SilverStripe - Adding Checkbox to CMS

This allows you to add a checkbox to CMS, and then display stuff in the frontend dependant on if it is ticked or not.

First you need to add the database field for it.

static $db = array(
'ShowExtraClass' => 'Boolean'
);

Then add the checkbox to the cms

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new CheckboxField ("ShowExtraClass"));
return $fields;
}

And finally you add the if statement in your template:
<% if ShowExtraClass %>

click here for the original website

Friday 9 December 2011

Magento - add image to phtml

Magento - add image to phtml
<img src="<?php echo $this->getSkinUrl('images/cassa/banner-overlay.png') ?>" alt="" id="banner-overlay" />

Tuesday 29 November 2011

Magento - Displaying Content on a product page depending on a product attribute

Magento - Displaying Content on a product page depending on a product attribute

This allows you to select a attribute in the cms that defines whether something shows up on a product page.

click here for the original website

Thursday 24 November 2011

Magento - Resize images

Magento - Resize images

The code below shows you how to proportionately resize an image to fit a box with the width 200px and height 100px.

->keepAspectRatio(TRUE)->resize(200,100)

click here for the original website

Friday 18 November 2011

Magento - local.xml

Magento - local.xml

Allows you to edit the layout of pages without the need to modify magento xml layout files

click here for the original website

Thursday 10 November 2011

SilverStripe - Client Area Setup

SilverStripe - Client Area Setup

click here for the original website

click here for the original website (extra information)

Thursday 20 October 2011

Silverstripe - Interesting Stuff

Silverstripe - Interesting Stuff

click here for the original website

Magento - sorting of the Layered JavaScript top.html menum, Alpha Sorting

Magento - sorting of the Layered JavaScript top.html menu
click here for the original website


Alpha Sorting

SET @i=0;
SET @j=0;
DROP TABLE IF EXISTS AAA_NEW_POSITION;
CREATE TABLE AAA_NEW_POSITION
SELECT e.entity_id AS 'entity_id',
vn.value AS 'name',
e.position AS 'old_position', @i:=@i+1 AS 'new_position'
FROM
catalog_category_entity e
LEFT JOIN catalog_category_entity_varchar vn
ON e.entity_id = vn.entity_id AND
vn.attribute_id = 33
ORDER BY vn.value;

ALTER TABLE AAA_NEW_POSITION ORDER BY name;
UPDATE AAA_NEW_POSITION SET new_position= @j:=@j+1 ORDER BY name;

UPDATE
catalog_category_entity e
LEFT JOIN AAA_NEW_POSITION np
ON e.entity_id = np.entity_id
SET
e.position = np.new_position;

DROP TABLE IF EXISTS AAA_NEW_POSITION;

Tuesday 4 October 2011

Silverstripe - Customise TinyMCE

Silverstripe - Customise TinyMCE

click here for a list of buttons
click here for information of how to insert the syntax
click here for the initial post that led me to these above answers

Wednesday 14 September 2011

FACEBOOK

remember to check the links are ALL correct!!!

check the "http:" at the beginning!!

Friday 2 September 2011

Silverstripe - Useful Information

A whole bunch of useful information, including how to get your url-segment and other predefined variables.

click here for the original website

Silverstripe - Getting friendly URLs working with SilverStripe on 1&1 (1and1)

Silverstripe - Getting friendly URLs working with SilverStripe on 1&1 (1and1)

click here for the original website, look at the 3rd post by Xochi

Silverstripe - Migrating a Silverstripe site

Silverstripe - Migrating a Silverstripe site

click here for the original website

Wednesday 24 August 2011

Magento - Creating a Configurable Product

Magento - Creating a Configurable Product

click here to view the original website

Silverstripe - User Defined Forms Page Template

Silverstripe - User Defined Forms Page Template

If you are using a the 'UserDefinedForms' module in Silverstripe you can set up a custom page layout just like you would a normal page layout, except you do not need to use a .php file to rebuild the database, instead just add a layout file (.ss) called UserDefinedForm.ss

click here for the original site

Friday 19 August 2011

Silverstripe Tutorials


tutorial 1 - building a basic site
tutorial 2 - extending a basic site
tutorial 3 - forms
tutorial 4 - site search
tutorial 5 - data object relationship management

Thursday 18 August 2011

Magento - Different Languages

If you want to change the language of your site use the procedure below.

A very easy procedure I found here click here

Wednesday 17 August 2011

Monday 15 August 2011

Magento Adding a link to an auto generated link list (top.links or footer_links)

Magento Adding a link to an auto generated link list (top.links or footer_links)

click here for the original website.

How to reorder links in auto generated link lists

click here for the original website.

Wednesday 10 August 2011

Magento Path Hints

Magento Path Hints, displays the blocks in the website template with red outlines and path descriptions

"turn on path hints in magento (admin > system configuration > developer > main website (configuration scope) > template path hints yes"

click here for the original website

Friday 5 August 2011

CSS Shadows

CSS Shadows

.shadow {
  -moz-box-shadow: 0px 0px 5px #555555;
  -webkit-box-shadow: 0px 0px 5px #555555;
  box-shadow: 0px 0px 5px #555555;
}

Thursday 4 August 2011

jQuery News Ticker

Click here to view the site I found this on.

Magento Missing HTML Head, Header & Footer in Admin > Design

I'd recently made a change to a magento installation so that I could use custom page layouts. During this I copied a file from a core directory to a local directory:


/app/code/core/Mage/Page/etc/config.xml
to
/app/code/local/Mage/Page/etc/config.xml

I then found out in the CMS is was missing some functionality:

Admin > Configuration > Design > { Missing } Head HTML, Header and Footer

To the regain this functionality, in the core folder above you have to copy both files, config.xml and system.xml over as you are switching the functionality from the core over to the local directory.

The original post I got this information from: click here

Wednesday 3 August 2011

Magento Creating a Configurable Product

click here

Magento Referencing a Static Block in a *.phtml file

use this snippet of code replacing 'IDENTIFIER' with the ID of your Static Block:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('INDENTIFIER')->toHtml() ?>

Reference in XML

XML Ref
<block type="cms/block" name="**REFERENCED IN phtml**">
<action method="setBlockId"><block_id>**STATIC BLOCK ID**</block_id></action>
</block>
phtml Ref
<?php echo $this->getChildHtml('**REFERENCED IN phtml**') ?>

click here for the original website

Tuesday 2 August 2011

Magento Referencing a *.phtml file in the CMS or using XML and php

 In CMS:

{{block type=”core/template” name=”top_static_links” template=”page/template/top_static_links.phtml”}}

In XML and php:

XML component:
<block type="core/template" name="top_static_links" template="page/template/top_static_links.phtml"/>
php component:
<?php echo $this->getChildHtml('top_static_links'); ?>

Just a php Call - NOT RECOMMENDED!
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('videoBannerStaticBlock')->toHtml() ?>

jQuery Image Rotator

jQuery image Rotator tutorial by DreamweaverTutorial.co.uk.

Part 1 and Part 2

Monday 1 August 2011

Magento linking to a CMS created page in the CMS

If you're looking to link to a CMS page using Magento's page editor, in the CMS, use this bit of code in the a href swapping out the "about-us" for the page identifier:

{{store direct_url="about-us"}}

example:
<a href="{{store direct_url="about-us"}}">About Us</a>

If you are linking to a Category, add .html to the end of the identifier.

Sunday 31 July 2011

960 Grid System

A link for web designers and developers.

The 960 Grid system allows you to create a website using as 12 or 16 columns each with a 10px margin on the left and right.

Go to their website to learn more

Friday 29 July 2011

Magento Referencing images in the CMS

Referencing an image in the Skin's images Folder
If you want to reference an image in your skin folder, in a page in magento (created using the CMS), use this bit of code in the "src":

{{skin url='images/image.gif'}}

example:
<img src="{{skin url='images/image.gif'}}" alt="alternate text" />

Referencing an image in the Media Folder
If you want to reference an image in the media folder, in a page in magento (created using the CMS), use this bit of code in the "src":

{{media url='images/image.gif'}}

example:
<img src="{{media url='image.gif'}}" alt="alternate text" />