0
Welcome Guest! Login
0 items Join Now

Adding CMScallouts

    • Krazza's Avatar
    • Krazza
    • Hero Rocketeer
    • Posts: 435
    • Thanks: 1

    Adding CMScallouts

    Posted 12 years 10 months ago
    • Ok these installed CMScallouts, or what they look like is custom modules, how do I add more than one on the left and right.??
    • Black & White must be making a come back
    • Sam Mahoney's Avatar
    • Sam Mahoney
    • Preeminent Rocketeer
    • Posts: 7420
    • Thanks: 222

    Re: Adding CMScallouts

    Posted 12 years 10 months ago
    • By default there's only one for each side. However, you could add another block, and have it display the contents of a cms static block, so you can still configure things from the admin. So, first, make a new cms block with your content to display (CMS -> Static Blocks -> Add New Block). Make a note of the "Identifier" you used as we'll need this.

      Next, open up app/design/frontend/base/default/layout/rokmage-cmscallouts/rokmagecmscallouts.xml and change it to the following:
      <layout version="0.1.0">
          
         <default>
              <reference name="root">
                  <block type="core/template" name="left.permanent.callout">
                      <action method="setTemplate" ifconfig="cms_callouts/general/enableleft">
                          <template>rokmagemodules/rokmage-cmscallouts/rokmage-left-cmscallout.phtml</template>
                      </action>
                  </block>
              </reference>
              <reference name="left">
                  <block type="core/template" name="left.permanent.callout.custom">
                      <action method="setTemplate" ifconfig="cms_callouts/general/enableleft">
                          <template>rokmagemodules/rokmage-cmscallouts/rokmage-left-cmscallout-custom.phtml</template>
                      </action>
                  </block>
              </reference>
              <reference name="root">
                  <block type="core/template" name="right.permanent.callout">
                      <action method="setTemplate" ifconfig="cms_callouts/general/enableright">
                          <template>rokmagemodules/rokmage-cmscallouts/rokmage-right-cmscallout.phtml</template>
                      </action>
                  </block>
              </reference>
          </default>
       
      </layout>
      Basically what we're doing there is adding a reference to the left sidebar, then adding another block inside that left sidebar with a template of rokmage-left-cmscallout-custom.phtml. Now we need to make this template file.

      So, go to app/design/frontend/base/default/template/rokmagemodules/rokmage-cmscallouts and copy/paste the rokmage-left-cmscallout.phtml file and rename it rokmage-left-cmscallout-custom.phtml. Then, open it up and replace the contents with the following:
      <div class="block callout">
          <div class="block-title">
              <strong><span><?php echo Mage::getModel('cms/block')->load('your-block-id-here', 'identifier')->getTitle(); ?></span></strong>
          </div>
          <div class="block-content">
          <?php echo $leftcontent ?>
          <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your-block-id-here')->toHtml(); ?>
          </div>
      </div>
       
      Where your-block-id-here is the one you used for your cms block. Now it should appear in the left sidebar showing the contents of the static block you made earlier.
    • The following users have thanked you: roma64

    • STEP 1 IN MAGENTO DEVELOPMENT - DISABLE YOUR CACHE OR YOU WON'T SEE ANY CHANGES.
      Use the new "secure" tab when replying for privately sharing links.
      Check the "Useful Snippets" post for tips.
  • Re: Adding CMScallouts

    Posted 12 years 9 months ago
    • I am getting some issues with this implementation.

      Please see the attached screen shot. I copied your code to the best of my abilities!

      Notice the missing gaps (when I changed the right callout to a left and added the facebook iframe code).

      Notice the strange characters of the new custom left cms callout.

      Any help is appreciated!
    • Sam Mahoney's Avatar
    • Sam Mahoney
    • Preeminent Rocketeer
    • Posts: 7420
    • Thanks: 222

    Re: Adding CMScallouts

    Posted 12 years 9 months ago
    • I guess that's some problem from copying the above code. Be sure to turn off line numbering, copy and paste it into some basic text editor, and make sure there's no additional characters or spacing being added before saving.
    • STEP 1 IN MAGENTO DEVELOPMENT - DISABLE YOUR CACHE OR YOU WON'T SEE ANY CHANGES.
      Use the new "secure" tab when replying for privately sharing links.
      Check the "Useful Snippets" post for tips.
  • Re: Adding CMScallouts

    Posted 12 years 9 months ago
    • I copied everything again and the strange characters went away.

      Thank you!

      However, I am still getting the transparency gap issue. Please see the attached screen shot.

      Ideas? Is it the facebook code? I am just copy/pasting from their site.
    • Sam Mahoney's Avatar
    • Sam Mahoney
    • Preeminent Rocketeer
    • Posts: 7420
    • Thanks: 222

    Re: Adding CMScallouts

    Posted 12 years 9 months ago
    • That's because the title is wrapping onto 2 lines and pushing the rest down a little. Try reducing your font-size slightly for the sidebar headings. Firebug will help pinpoint what to edit.
    • STEP 1 IN MAGENTO DEVELOPMENT - DISABLE YOUR CACHE OR YOU WON'T SEE ANY CHANGES.
      Use the new "secure" tab when replying for privately sharing links.
      Check the "Useful Snippets" post for tips.

Time to create page: 0.044 seconds