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

Export Categories and Images via Custom PHP Script (for Flash Menu/Banner whatever)
 
tronics_1
Member
 
Total Posts:  46
Joined:  2008-01-17
 

Hello!

This one would be really useful for a flash Menu/Banner or for a sitemap:
Generate the “top level” category names and links (eventually also with according top positioned images).

--

I just started out but have this problem:
I do not see how to use the core functionality without the templating system.
The XML export should be generated in a single file.

How to initialize the shop object?
With the code below I get obvious: Fatal error: Using $this when not in object context

--

<?php

$mageFilename 
'app/Mage.php';

if (!
file_exists($mageFilename)) {
    
if (is_dir('downloader')) {
        header
("Location: downloader");
    
else {
        
echo $mageFilename." was not found";
    
}
    
exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

#Mage::setIsDeveloperMode(true);

#ini_set('display_errors', 1);

?>
<?php 
foreach ($this->getStoreCategories() as $_category): ?>
    
<a href="<?php echo $this->getCategoryUrl($_category); ?>"><?php echo $this->htmlEscape($_category->getName()); ?></a>
<?php endforeach ?>

Thanks.

Regards,
tronics

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top