Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Anyone have any experience with the cms_pages module. 
 
Mage Guru
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-07
 

Added another content area in the cms, but having difficulty pulling the info on the frontend. Let me know if anyone can help.

I added this to app/code/core/mage/adminhtml/block/cms/page/edit/tab/content.php

$contentField2 = $fieldset->addField(’content_2’, ‘editor’, array(
‘name’ => ‘content_2’,
‘style’ => ‘height:36em;’,
‘required’ => false,
‘disabled’ => $isElementDisabled,
‘config’ => $wysiwygConfig
));

And also added the field in the database so I can add and edit. I just can’t work out how to pull the info on the frontend?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Mentor
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Can you tell me how you are trying to access the data on the frontend

Also, I would recommend adding your code to your local directory and not modifying your core

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mage Guru
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-07
 

Thats the problem. I dont know how to access the data in the frontend. Using the default template.

I assume it would want to use <?php echo $this->getChildHtml('content') ?> somehow, but ideally it would be good if I could use another like <?php echo $this->getChildHtml('content2') ?>

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Mentor
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

What did you put in your block?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mage Guru
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-07
 

I don’t understand your question? So far the only changes I have made are to the app/code/core/mage/adminhtml/block/cms/page/edit/tab/content.php file.

:(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Mentor
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Sorry, meant to say have you confirm the data is being saved in your database.

Also, you know when you do any updates your changes will be erased since you are modifying core code

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mage Guru
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2009-07-07
 

Data is being saved in the database and I will take it out of the core once I get it working. smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
nonoobsnofun
Jr. Member
 
Total Posts:  6
Joined:  2011-01-19
 

Didn’t play with cms_pages on Magento. But generally, it is supposed to be able to put your customised code somewhere in block.
And reckon it’s not a proper way to test code by hacking core ^^

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Mentor
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Ok can you tell me how you are trying to access the block from your CMS?

It helps to use the code blocks in the forum:

$contentField2 $fieldset->addField(’content_2’‘editor’, array( 
‘name’ => â€˜content_2’
‘style’ => â€˜height:36em;’
‘required’ => false
‘disabled’ => $isElementDisabled
‘config’ => $wysiwygConfig 
));
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top