<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Promet Knowledge Sharing</title>
	<atom:link href="http://codes.prometsupport.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codes.prometsupport.com</link>
	<description></description>
	<pubDate>Tue, 14 Jul 2009 21:50:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Lullabot Drupal CCK video series</title>
		<link>http://codes.prometsupport.com/2009/07/14/lullabot-drupal-cck-video-series/</link>
		<comments>http://codes.prometsupport.com/2009/07/14/lullabot-drupal-cck-video-series/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 21:50:26 +0000</pubDate>
		<dc:creator>andy</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Drupal Knowledge Sharing]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=62</guid>
		<description><![CDATA[The good folks at Lullabot have been busy adding video courses to their site.  We like their CCK video course enough to share with everyone.  Please share your thoughts on the video - and please fill out this Formhttps://spreadsheets.google.com/viewform?formkey=clNmNnpJZktMRnNJa2J6YUVZLVhjeXc6MA..If you have not received a copy of the video, contact me please.]]></description>
			<content:encoded><![CDATA[The good folks at <a href="http://www.lullabot.com" target="_blank">Lullabot </a>have been busy adding video courses to their site.  We like their CCK video course enough to share with everyone.  <br /><br />Please share your thoughts on the video - and please fill out this <a href="https://spreadsheets.google.com/viewform?formkey=clNmNnpJZktMRnNJa2J6YUVZLVhjeXc6MA.." target="_blank">Form</a><br /><br /><a href="https://spreadsheets.google.com/viewform?formkey=clNmNnpJZktMRnNJa2J6YUVZLVhjeXc6MA.." target="_blank">https://spreadsheets.google.<wbr />com/viewform?formkey=<wbr />clNmNnpJZktMRnNJa2J6YUVZLVhjeX<wbr />c6MA..</a><br /><br />If you have not received a copy of the video, contact me please.]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/07/14/lullabot-drupal-cck-video-series/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Magento: How to Create an Extension with its own Layout</title>
		<link>http://codes.prometsupport.com/2009/05/27/magento-how-to-create-an-extension-with-its-own-layout/</link>
		<comments>http://codes.prometsupport.com/2009/05/27/magento-how-to-create-an-extension-with-its-own-layout/#comments</comments>
		<pubDate>Wed, 27 May 2009 13:49:42 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=59</guid>
		<description><![CDATA[I was studying how to create a Magento extension and I found a great solution in this blog but I got stucked when I wanted to use my own html layout and templates.  The documentation lacks but I found great help in the forum. I&#8217;ll summarize here what I did so far.1. Create your [...]]]></description>
			<content:encoded><![CDATA[I was studying how to create a Magento extension and I found a great solution in <a href="http://t.wits.sg/2009/03/31/howto-repackageable-custom-extension-development-in-magento/">this blog</a> but I got stucked when I wanted to use my own html layout and templates.  The documentation lacks but I found great help in the <a href="http://www.magentocommerce.com/boards/viewthread/22366/">forum</a>. I&#8217;ll summarize here what I did so far.<br /><br /><strong>1. Create your directory structure</strong><br /><pre>app/
  etc/
    modules/
      - GroupName_All.xml 
  code/
    local/
      GroupName/ 
        ExtensionName/ (Or whatever your module name might be)
          Block/
          controllers/
            - IndexController.php
          etc/
            - config.xml
  design/
    frontend/
      default/
        yourtemplate/
          layout/
            extensionname.xml
          template/
            extensionname/
              form/
                index.phtml</pre><br /><strong>2. Create your config.xml at app/local/GroupName/ExtensionName/etc/config.xml</strong><br /><br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard9" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=9&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline"></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupname_extensionname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.0.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupname_extensionname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">&nbsp;</pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;frontend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;routers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">12</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;use<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>standard<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/use<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">13</td><td class="devcodelinesarea"><pre class="devcode devcodeline">                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;args<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">14</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;module<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GroupName_ExtensionName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/module<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">15</td><td class="devcodelinesarea"><pre class="devcode devcodeline">                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;frontname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>extensionname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/frontname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">16</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/args<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">17</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">18</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/routers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">19</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/frontend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">20</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div></pre>
<br />And another one at app/etc/modules/GroupName_All.xml . This one enables our extension.<br /><br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard10" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=10&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline"></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span></pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GroupName_ExtensionName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>local<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GroupName_ExtensionName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline"></pre></td></tr></table></div></pre>
<br /><strong>3. Create your first controller at app/local/GroupName/ExtensionName/controllers/IndexController.php</strong><br /><br /><pre class="devcodeblock" title="PHP"><table class="devcodetools"><tbody><tr><td>&nbsp;PHP&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard11" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=11&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #000000; font-weight: bold;">&lt;?php</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">2</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #000000; font-weight: bold;">class</span> GroupName_ExtensionName_IndexController <span style="color: #000000; font-weight: bold;">extends</span> Mage_Core_Controller_Front_Action <span style="color: #009900;">&#123;</span></pre></td></tr><tr><td class="devcodelines" width="1%">3</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">4</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr><tr><td class="devcodelines" width="1%">5</td><td class="devcodelinesarea"><pre class="devcode devcodeline">        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">renderLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">6</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">    <span style="color: #009900;">&#125;</span></pre></td></tr><tr><td class="devcodelines" width="1%">7</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;">&#125;</span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">8</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"></pre></td></tr></table></div></pre>
<br />You can access this page in <a href="http://localhost/magento/extensionname/">http:/localhost/magento//extensionname/</a> but the complete url is <a href="http://localhost/magento/extensionname/{index}/{index}">http://localhost/magento/extensionname/{index}/{index}</a> . by default, magento looks for IndexController and indexAction when they are not specified. Refresh your cache and visit the above URL. You should see the default 3-column layout with nothing in the middle. Our next step is to add our &#8220;Hello World&#8221; content using only a 1-column layout.<br /><br /><strong>4. Reopen our config.xml and add the following inside the &lt;frontend> tag and right after the &lt;routers> tag </strong><br /><br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard12" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=12&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">        </pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">2</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">3</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updates<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">4</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionname</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;GroupName_ExtensionName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr><tr><td class="devcodelines" width="1%">5</td><td class="devcodelinesarea"><pre class="devcode devcodeline">                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>extensionname.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/file<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">6</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionname<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">7</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updates<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">8</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> </pre></td></tr><tr><td class="devcodelines" width="1%">9</td><td class="devcodelinesarea"><pre class="devcode devcodeline"></pre></td></tr></table></div></pre>
<br />The above settings tells Magento to look for extensionname.xml in our layout. Create that file in app/design/frontend/default/yourtemplate/layout/extensionname.xml<br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard13" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=13&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">01</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">02</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr><tr><td class="devcodelines" width="1%">03</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">04</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">05</td><td class="devcodelinesarea"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extensionname_index_index<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">06</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;root&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr><tr><td class="devcodelines" width="1%">07</td><td class="devcodelinesarea"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setTemplate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/2columns-left.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">08</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">09</td><td class="devcodelinesarea"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">10</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;core/template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;extensionname_form_index&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;toHtml&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;extensionname/form/index.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/block<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">11</td><td class="devcodelinesarea"><pre class="devcode devcodeline">        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/reference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines devcodelinesodd" width="1%">12</td><td class="devcodelinesarea devcodelinesareaodd"><pre class="devcode devcodeline">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extensionname_index_index<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr><tr><td class="devcodelines" width="1%">13</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> </pre></td></tr></table></div></pre>
<br />Let me explain what happend here.<br />The tag extensionname_index_index is generated using the format: <br />ExtensionName frontname that you specified in the config.xml + the controller name + the action name.<br /><br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard14" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=14&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;setTemplate&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/2columns-left.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div></pre>
- set our template to 1column layout. You can change it to 2columns-left, 2columns-right or 3columns.<br /><br /><pre class="devcodeblock" title="XML"><table class="devcodetools"><tbody><tr><td>&nbsp;XML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard15" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=15&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;block</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;core/template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;extensionname_form_index&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;toHtml&quot;</span> <span style="color: #000066;">template</span>=<span style="color: #ff0000;">&quot;extensionname/form/index.phtml&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/block<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div></pre>
- the template attribute tells where to look for the html file in our template directory. The type attribute is used to tell Magento where to look for Helper file while the name is the name of the block.<br /><br />Now we need to create our HTML file. Create a file in app/design/frontend/default/yourtemplate/template/extensionname/form/index.phtml (see the similarity in the template attribute above?) and add the following <br /><pre class="devcodeblock" title="HTML"><table class="devcodetools"><tbody><tr><td>&nbsp;HTML&nbsp;|&nbsp;</td><td style="background-image:url('http://codes.prometsupport.com/wp-content/plugins/devformatter/img/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;"/><embed id="ZeroClipboard16" src="http://codes.prometsupport.com/wp-content/plugins/devformatter/_zclipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="16px" height="16px" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=16&width=16&height=16" wmode="transparent" /></td><td>&nbsp;copy&nbsp;code&nbsp;|</td><td style="cursor:pointer" title="DevFormatter Plugin" onclick="devfmt_credits()">?</td><td width="99%">&nbsp;</td></tr></tbody></table><div class="devcodeoverflow"><table class="devcodearea" width="100%"><tr><td class="devcodelines" width="1%">1</td><td class="devcodelinesarea"><pre class="devcode devcodeline">Hello World!</pre></td></tr></table></div></pre>
<br />Refresh your page and you should see a 1-column layout with a Hello world! Try the other columns and add more contents.<br /><br />Next time, I&#8217;ll post how to add forms and use helpers.<br />]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/05/27/magento-how-to-create-an-extension-with-its-own-layout/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Building a Squidoo like application with Drupal</title>
		<link>http://codes.prometsupport.com/2009/05/04/building-a-squidoo-like-application-with-drupal/</link>
		<comments>http://codes.prometsupport.com/2009/05/04/building-a-squidoo-like-application-with-drupal/#comments</comments>
		<pubDate>Mon, 04 May 2009 07:01:00 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=56</guid>
		<description><![CDATA[Topicko.com is a squidoo like application with more features that enable users to connect with each other.  This site was created using Drupal 6. Today, I’ll discuss one part of the application &#38;mdash; how to build a site that allows users to add contents dynamically using squidoo modules.<br />Modules needed:	CCK<br />	Flexifield<br />	other optional cck modules to your likings. [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><a href="http://www.topicko.com">Topicko.com</a> is a <a href="http://www.squidoo.com">squidoo</a> like application with more features that enable users to connect with each other.  This site was created using Drupal 6. Today, I’ll discuss one part of the application &amp;mdash; how to build a site that allows users to add contents dynamically using squidoo modules.</p>
<p class="MsoNormal">Modules needed:</p><ul><br />	<li><a href="http://drupal.org/project/cck">CCK</a></li>
	<li><a href="http://drupal.org/project/flexifield">Flexifield</a></li>
	<li>other optional cck modules to your likings. In this example, we will use text, <a href="http://drupal.org/project/link">link</a> and <a href="http://drupal.org/project/emfield">emfield</a></li>
</ul><p class="MsoNormal">Our goal is to make a content type that enable writers and editors to dynamically add and reorder sections in their content. Sections in this page refers to the &#8220;modules&#8221; of squidoo, eg Amazon, Poll, RSS feed, Guest book, Text module and Youtube vids.</p><p class="MsoNormal"></p><p class="MsoNormal"><strong>Steps:</strong></p><p class="MsoNormal">1. First is to install CCK, flexifield and the optional modules (text, link, emfield). For emfield, you may just select the video media.</p><p class="MsoNormal">2. Flexifield only accepts valid content types and not individual cck modules. In order to utilize flexifield, create separate content types for the text, link and emfield which only contains their respective contents for simplicity. You can add more once you are familiar with the steps.</p><p class="MsoNormal">3. Create your primary content type, in this example we will use &#8220;squidoo&#8221; as our content type. Add a new flexifield. In the flexifield system settings, select the boxes for the Text, Link and Emfield content types. Set the <i>Number of Values</i> to unlimited.</p><p class="MsoNormal">4. Add a new squidoo content.</p><p class="MsoNormal">The following is a shot taken from the actual topicko&#8217;s <em>add topic</em>. It will show you how to add new fields and reorder them.</p>
<object width="646" height="418"><param name="movie" value="http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/jingswfplayer.swf"></param><param name="quality" value="high"></param><param name="bgcolor" value="#FFFFFF"></param><param name="flashVars" value="thumb=http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/FirstFrame.jpg&#038;containerwidth=746&#038;containerheight=518&#038;loaderstyle=jing&#038;content=http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/2009-05-04_1438.swf"></param><param name="allowFullScreen" value="true"></param><param name="scale" value="showall"></param><param name="allowScriptAccess" value="always"></param><param name="base" value="http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/"></param>  <embed src="http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="646" height="418" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/FirstFrame.jpg&#038;containerwidth=746&#038;containerheight=518&#038;loaderstyle=jing&#038;content=http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/2009-05-04_1438.swf" allowFullScreen="true" base="http://content.screencast.com/users/primerg/folders/Jing/media/9b457905-f902-43f8-bc8c-1978ff76713d/" scale="showall"></embed> </object>]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/05/04/building-a-squidoo-like-application-with-drupal/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This weeks theme is “Blocks”</title>
		<link>http://codes.prometsupport.com/2009/04/14/this-weeks-theme-is-%e2%80%9cblocks%e2%80%9d/</link>
		<comments>http://codes.prometsupport.com/2009/04/14/this-weeks-theme-is-%e2%80%9cblocks%e2%80%9d/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:16:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Drupal Knowledge Sharing]]></category>

		<category><![CDATA[blocks]]></category>

		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[knowledge]]></category>

		<category><![CDATA[knowledge sharing]]></category>

		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=49</guid>
		<description><![CDATA[**We must all watch the video below on Drupal blocks and communicate at least one of the following:	Those with Questions: You must post at least 1 question you may have about blocks.	Post your question.<br />	Search for the answer to that question online or ask a co-worker who may be more knowledgeable.<br />	Post the answers you get.<br />	Post how [...]]]></description>
			<content:encoded><![CDATA[**We must all watch the video below on Drupal blocks and communicate at least one of the following:<ul><br />	<li>Those with Questions: You must post at least 1 question you may have about blocks.<ul><br />	<li>Post your question.</li>
	<li>Search for the answer to that question online or ask a co-worker who may be more knowledgeable.</li>
	<li>Post the answers you get.</li>
	<li>Post how getting the answer to your question helped you.</li>
</ul>
</li>
	<li>Those with Experiences to Share: You must post at least 1 experience you have had building blocks.<ul><br />	<li>Post the client/manager request.</li>
	<li>Post how you decided on implementing the request into a block.</li>
	<li>Post the staging link to the implementation.</li>
	<li>Post a screenshot of the block and where it is on the site so there is no confusion.</li>
</ul>
</li>
</ul>
The following video briefly explains what blocks are and how to create them:<br /><a href="http://www.youtube.com/watch?v=Hs_5IT1-K00">http://www.youtube.com/watch?v=Hs_5IT1-K00</a><br /> <br /> <br />Happy sharing!]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/04/14/this-weeks-theme-is-%e2%80%9cblocks%e2%80%9d/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drupal Weekly Knowledge Sharing</title>
		<link>http://codes.prometsupport.com/2009/04/14/drupal-weekly-knowledge-sharing/</link>
		<comments>http://codes.prometsupport.com/2009/04/14/drupal-weekly-knowledge-sharing/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Drupal Knowledge Sharing]]></category>

		<category><![CDATA[blocks]]></category>

		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[knowledge]]></category>

		<category><![CDATA[knowledge sharing]]></category>

		<category><![CDATA[modules]]></category>

		<category><![CDATA[share]]></category>

		<category><![CDATA[themes]]></category>

		<category><![CDATA[theming]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=46</guid>
		<description><![CDATA[It is unfortunate that we are not all able to attend the various knowledge sharing conventions and meetings that help us understand the products we sell and how to use those products to the best of their ability. I am speaking of products such as Drupal, CakePHP and others we promote. Some of us have [...]]]></description>
			<content:encoded><![CDATA[It is unfortunate that we are not all able to attend the various knowledge sharing conventions and meetings that help us understand the products we sell and how to use those products to the best of their ability. I am speaking of products such as Drupal, CakePHP and others we promote. Some of us have learned how these products work and are best implemented by trial and error. Others have been able to sit and listen to a step by step presentation. While both are valuable, each produces various methods of achieving our goals. Some are fantastic and some produce headache’s for us later on down the road.<br /> <br />This page will provide the launching pad for a series of learning and sharing programs that all of us will be a part of. If you have questions on what is being taught or discussed, you must find the answers online or by reaching out to a co-worker. If your level of knowledge is well above the lesson or presentation, please help with answering others questions. <br /><br />Finally, we believe that everyone on our team has a valuable lesson that may be shared with the rest.  Please submit your ideas or cool info you’d like to share with the rest of the team to Chris <a href="mailto:chris@promethost.com"><span style="color: #0061b6;">chris@promethost.com</span></a> or Matt <a href="mailto:matt@promethost.com"><span style="color: #0061b6;">matt@promethost.com</span></a> .  Some of the best suggestions will be rewarded!  Your tip should also include some basic questions that would stimulate further thoughts on the subject or just test the understanding of the lesson.]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/04/14/drupal-weekly-knowledge-sharing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>img_assist inline image does not appear</title>
		<link>http://codes.prometsupport.com/2009/03/09/img_assist-inline-image-does-not-appear/</link>
		<comments>http://codes.prometsupport.com/2009/03/09/img_assist-inline-image-does-not-appear/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 08:29:03 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=36</guid>
		<description><![CDATA[There seems to be lack of documentation on how to properly install img_assist. It took me a while before I figured out how to make the img_assist inline images appear in node content. So here it is:img_assist will only display images if the Input Format of the current node is Full HTML. You can select [...]]]></description>
			<content:encoded><![CDATA[There seems to be lack of documentation on how to properly install img_assist. It took me a while before I figured out how to make the img_assist inline images appear in node content. So here it is:<br /><br />img_assist will only display images if the Input Format of the current node is Full HTML. You can select the default Input format to HTML by setting it in the Input Format Configuration page (go to Admin &gt; Site Configuraiton &gt; Input Formats). Selecting the Full HTML option is not enough though. We need to configure this so it can recognize the img_assist tag. In the Input Format configuration page again, click the configure link of the Full HTML option. Under the Filters group, make sure to check the  <em>Inline images</em> checkbox. As per the description, it will add images to your posts with Image assist.<br /><br />And that&#8217;s it. The images should appear.]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2009/03/09/img_assist-inline-image-does-not-appear/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ternary Operator</title>
		<link>http://codes.prometsupport.com/2008/12/11/ternary-operator/</link>
		<comments>http://codes.prometsupport.com/2008/12/11/ternary-operator/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 13:49:09 +0000</pubDate>
		<dc:creator>jun</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[ternary]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=22</guid>
		<description><![CDATA[Usually we use the following snippet of code to assign a value in a variable given a condition:&#60;?phpif (cond) {v = value1} else {v = value2}?&#62;This code can be expressed using the ternary operator.&#60;?phpv = cond ? value1 : value2;?&#62;Of course we can use the ternary operator with nested conditions.&#60;?phpv = cond ? (cond1 ? [...]]]></description>
			<content:encoded><![CDATA[Usually we use the following snippet of code to assign a value in a variable given a condition:<br /><br /><strong>&lt;?php<br />if (cond) {<br />v = value1<br />} else {<br />v = value2<br />}<br />?&gt;</strong><br /><br />This code can be expressed using the ternary operator.<br /><br /><strong>&lt;?php<br />v = cond ? value1 : value2;<br />?&gt;</strong><br /><br />Of course we can use the ternary operator with nested conditions.<br /><br /><strong>&lt;?php<br />v = cond ? (cond1 ? value11 : value12) : (cond2?:value21:value22);<br />?&gt;</strong><br /><br />But that isn&#8217;t really an advisable option <img src='http://codes.prometsupport.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2008/12/11/ternary-operator/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drupal Comment Moderation</title>
		<link>http://codes.prometsupport.com/2008/12/11/drupal-comment-moderation/</link>
		<comments>http://codes.prometsupport.com/2008/12/11/drupal-comment-moderation/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 09:18:00 +0000</pubDate>
		<dc:creator>rachel</dc:creator>
		
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=25</guid>
		<description><![CDATA[I&#8217;ve been working on a project using Drupal as our &#8220;framework&#8221;. One of our requirements is to allow our authors to moderate comments. What I mean by comment moderation is	allow the author to enable or disable commenting on their post; and<br />	dictate if they want the comments to be approved or denied first before getting published [...]]]></description>
			<content:encoded><![CDATA[I&#8217;ve been working on a project using Drupal as our &#8220;framework&#8221;. One of our requirements is to allow our authors to moderate comments. What I mean by comment moderation is<ol><br />	<li>allow the author to enable or disable commenting on their post; and</li>
	<li>dictate if they want the comments to be approved or denied first before getting published in the public</li>
</ol>
Right now, only administrators are allowed to dictate if a node will accept comments or not. And it seems that Drupal core team does not have any plans on adding that, yet. There is however a module available that let users <a href="http://drupal.org/project/usercomment">delete/edit/approve comments</a> and overrides the permissions by the core. But, this still does satisfy my first requirement. Luckily I was toying with the Rules and CCK module and with them I was able to accomplish the first requirement without creating a new module or hacking another module — just pure administrative manipulation.<br /><br />In order to get us rolling, we need 3 modules: <a href="http://drupal.org/project/rules">Rules</a>, <a href="http://drupal.org/project/cck">CCK</a> and PHP filter. PHP filter is already included in Drupal 6 (or D6 for short) so you have to download the first 2 modules. There are 3 major steps to fullfill this:<ol><br />	<li>Add a CCK field</li>
	<li>Create a new rule</li>
	<li>Test</li>
</ol>
Lastly, this one is intended for D6 only. I haven&#8217;t tested in D5 and will never be.<br /><h3 style="font-weight: bold">Add a CCK field</h3>
This step will just mimic how an admin can enable/disable comments. Follow these steps.<ol><br />	<li>Go to <span style="text-decoration: underline;">Administer</span> &gt; <span style="text-decoration: underline;">Content management</span> &gt; <span style="text-decoration: underline;">Content types</span> (this is located in the navigation block. each underlined text means a link in your drupal site)<span style="text-decoration: underline;"><br /></span></li>
	<li>Click &#8220;<span style="text-decoration: underline;">manage fields</span>&#8221; of the node type you wish. For this tutorial, we will use <em>Page</em></li>
	<li>Add a new field with the following attributes (you can change this later if you wish)<br />Label: <em>Comment moderation</em><br />fieldname: <em>comment</em><br />Type of data to store: <em>Text</em><br />Form element to edit the data: <em>Check boxes/radio buttons</em></li>
	<li>On the next page, copy and paste the following text in the Allowed values<br /><em> 0|Disable<br />1|Read<br />2|Read/Write</em></li>
	<li>Optionally you can change other attributes and when your done click save button.</li>
</ol>
This will add a new field in your pages. Try to create or edit a page to see the added field in your edit form.<br /><h3 style="font-weight: bold">Create a new rule</h3>
This one will be a bit long but if you are already used to rules, then it is a piece of cake!<ol><br />	<li>Go to <span style="text-decoration: underline;">Administer</span> &gt; <span style="text-decoration: underline;">Rules</span> &gt; <span style="text-decoration: underline;">Triggered rules</span></li>
	<li>Add a new rule (check the tab)</li>
	<li>Use the following information<br />Label: <em>Comment moderation</em><br />Event: <em>Content is going to be saved</em><br />Click save changes button</li>
	<li>You have created a new rule! But we are not done yet. Let&#8217;s add some conditions (click the <span style="text-decoration: underline;">add a condition</span> link at the Rule elements group).</li>
	<li>In the next page, select <em>Field has changed</em> option and submit.</li>
	<li>Then we can start adding more information regarding this condition. The only important fields you should fill up is the <strong>Field</strong>. Make sure to select our newly created CCK field - <em>field_comment.</em> Do not change anything except for the label if you want and then click the Save button.</li>
	<li>You are then redirected to the Comment moderation edit page. Let&#8217;s add a new action (click the <span style="text-decoration: underline;">add an action</span> link at the Rule elements group).</li>
	<li>In the next page, select <em>Execute custom PHP code</em> (that is why we need the PHP filter so we can write some code) and click Forward button.</li>
	<li>Next, edit the label to your liking and in the PHP Code textarea, copy and paste the following:<br />// change the comment moderation status<br />$node-&gt;comment = $node-&gt;field_comments[0]['value'];<br />return array(&#8221;node&#8221; =&gt; $node);</li>
	<li>Click save and we are done.</li>
</ol>
What will happen here is that when the node is created or updated (Step #3), it will check for a condition which we did in Step #5. If the condition is met, and that the <em>field_comment</em>&#8217;s value was changed, it will process the stated actions we added in Step #9. The code means it wants to replace the default comment status to the selected values of <em>field_comment</em>.<br /><h3 style="font-weight: bold">Testing</h3>
We are now ready to test it. Create a new page or edit the page you created before. Try to disable and enable the values and save. It should be working. If not, let me know the problem in the comment box.<br /><br />You might also notice that in your page view, you will see the Comment option has been displayed. We can hide this in the admin. Let&#8217;s go back again to our Content type administration area (<span style="text-decoration: underline;">Administer</span> &gt; <span style="text-decoration: underline;">Content management</span> &gt; <span style="text-decoration: underline;">Content types</span>). Click manage fields and then click Display fields tab. Just change the Teaser and Full node column of your <em>field_comment</em> to <em>&lt;Hidden&gt;</em>. It will hide the field to the page view. Check again.<br /><h3 style="font-weight: bold">What&#8217;s next?</h3>
There is no next! If you ever uninstalled Comment module, just deactivate this rule to save some processing time but it&#8217;s not required.]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2008/12/11/drupal-comment-moderation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Browser Test Tools</title>
		<link>http://codes.prometsupport.com/2008/09/02/browser-test-tools/</link>
		<comments>http://codes.prometsupport.com/2008/09/02/browser-test-tools/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 05:55:02 +0000</pubDate>
		<dc:creator>tere</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[browsers]]></category>

		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=12</guid>
		<description><![CDATA[Wondering how your website look in different browsers? Check out the following for a view on how your website might look on a certain browser.	Browsershots.org <br />	IE NetRenderer<br />	Browsercam<br />	Browsrcamp.com<br />]]></description>
			<content:encoded><![CDATA[Wondering how your website look in different browsers? Check out the following for a view on how your website might look on a certain browser.<ul><br />	<li><a href="http://browsershots.org/" target="_blank">Browsershots.org</a> </li>
	<li><a href="http://ipinfo.info/netrenderer/" target="_blank">IE NetRenderer</a></li>
	<li><a href="http://www.browsercam.com/Default2.aspx" target="_blank">Browsercam</a></li>
	<li><a href="http://www.browsrcamp.com/" target="_blank">Browsrcamp.com</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2008/09/02/browser-test-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>InnerHTML in Firefox</title>
		<link>http://codes.prometsupport.com/2008/08/21/innerhtml-in-firefox/</link>
		<comments>http://codes.prometsupport.com/2008/08/21/innerhtml-in-firefox/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 10:28:35 +0000</pubDate>
		<dc:creator>tere</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://codes.prometsupport.com/?p=9</guid>
		<description><![CDATA[I ran once an error in InnerHTML when trying to display AJAX imported form fields and post the values entered for these fields. The values were being passed when the form is submitted in IE, but not in Firefox. Firefox only returns a javascript error stating that the field has no properties and thus returning [...]]]></description>
			<content:encoded><![CDATA[I ran once an error in InnerHTML when trying to display AJAX imported form fields and post the values entered for these fields. The values were being passed when the form is submitted in IE, but not in Firefox. Firefox only returns a javascript error stating that the field has no properties and thus returning an undefined value.<br /><br />After much trials-and-error reconstructing the AJAX imported field and searching the net for a possible solution, I came upon this site (<a href="http://www.robertnyman.com/2006/04/20/we-all-love-innerhtml/">http://www.robertnyman.com/2006/04/20/we-all-love-innerhtml/</a>) where the fix came from one of the readers’ comments.<br /><br />You need to make the form, where the AJAX imported form fields are located, nested correctly. As for my case, it should follow the correct nesting layout between forms and table. So I changed this previous layout:<br /><br />&lt;table&gt;<br /> &lt;form&gt; <br />   …. Other elements here ..<br /> &lt;/form&gt;<br />&lt;/table&gt;<br /><br />To this:<br /><br />&lt;form&gt;<br />  &lt;table&gt;<br />   …. Other elements here ..<br />  &lt;/table&gt;<br />&lt;/form&gt;<br /><br />And that did the trick, I was then able to submit values entered from the AJAX generated fields passed through innerHTML in Firefox.]]></content:encoded>
			<wfw:commentRss>http://codes.prometsupport.com/2008/08/21/innerhtml-in-firefox/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

