Creare_DynamicSitemap - Version 2.0.3

Version Notes

Updated to work on 1.4+ with admin configuration.

More fixed for store view and is_active CMS pages

Download this release

Release Info

Developer Magento Core Team
Extension Creare_DynamicSitemap
Version 2.0.3
Comparing to
See all releases


Code changes from version 2.0.0 to 2.0.3

app/code/local/Creare/DynamicSitemap/Block/Dynamicsitemap.php CHANGED
@@ -1,9 +1,13 @@
1
  <?php
2
- class Creare_DynamicSitemap_Block_Dynamicsitemap extends Mage_Core_Block_Template{
 
3
 
4
  public function getCreareCMSPages(){
5
 
6
- $cms = Mage::getModel('cms/page')->getCollection();
 
 
 
7
  $url = Mage::getBaseUrl();
8
  $html = "";
9
  foreach($cms as $cmspage):
1
  <?php
2
+ class Creare_DynamicSitemap_Block_Dynamicsitemap extends Mage_Core_Block_Template
3
+ {
4
 
5
  public function getCreareCMSPages(){
6
 
7
+ $storeId = $this->helper('core')->getStoreId(); // thanks to drawandcode for this
8
+ $cms = Mage::getModel('cms/page')->getCollection()
9
+ ->addFieldToFilter('is_active',1)
10
+ ->addStoreFilter($storeId);
11
  $url = Mage::getBaseUrl();
12
  $html = "";
13
  foreach($cms as $cmspage):
app/code/local/Creare/DynamicSitemap/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Creare_DynamicSitemap>
5
- <version>2.0</version>
6
  </Creare_DynamicSitemap>
7
  </modules>
8
  <frontend>
2
  <config>
3
  <modules>
4
  <Creare_DynamicSitemap>
5
+ <version>2.0.2</version>
6
  </Creare_DynamicSitemap>
7
  </modules>
8
  <frontend>
app/design/frontend/base/default/template/creare/dynamicsitemap/sitemap.phtml CHANGED
@@ -1,81 +1,80 @@
1
- <div class="ones-column">
2
- <?php if(Mage::helper('dynamicsitemap')->showCMS() || Mage::helper('dynamicsitemap')->showXMLSitemap()): ?>
3
- <div class="sitempan">
4
- <h2 class="smh2">Our Main Site Pages</h2>
5
- <ul class="siteul">
6
- <?php if(Mage::helper('dynamicsitemap')->showCMS()): ?>
7
- <?php echo $this->getCreareCMSPages(); // prints out our cms page ?>
8
- <?php endif; ?>
9
- <?php if(Mage::helper('dynamicsitemap')->showXMLSitemap()): ?>
10
- <?php $sitemap = Mage::getModel('sitemap/sitemap')->load(1); ?>
11
- <?php $sitemapfilename = $sitemap->getSitemapFilename(); ?>
12
- <?php if($sitemapfilename != ""): ?>
13
- <li><a href="<?php echo Mage::getBaseUrl().$sitemapfilename; ?>" title="XML Sitemap">XML Sitemap</a></li>
14
- <?php endif; ?>
15
- <?php endif; ?>
16
- </ul>
17
- <?php endif; ?>
18
- <?php if(Mage::helper('dynamicsitemap')->showAccount() || Mage::helper('dynamicsitemap')->showContact()): ?>
19
- <ul class="siteul">
20
- <?php if(Mage::helper('dynamicsitemap')->showContact()): ?>
21
- <li><a href="<?php echo Mage::getBaseUrl(); ?>contacts" title="Contact">Contact</a></li>
22
- <?php endif; ?>
23
- <?php if(Mage::helper('dynamicsitemap')->showAccount()): ?>
24
- <?php
25
- if($this->helper('customer')->isLoggedIn()) {
26
- echo '<li><a href="'.Mage::getBaseUrl().'customer/account/index/" title="Account">Account</a></li>';
27
- echo '<li><a href="'.Mage::getBaseUrl().'customer/account/logout/" title="Log Out">Log Out</a></li>';
28
- } else {
29
- echo '<li><a href="'.Mage::getBaseUrl().'customer/account/" title="Register/Log In">Register/Log In</a></li>';
30
- }
31
- ?>
32
- <li><a href="<?php echo Mage::getBaseUrl(); ?>catalogsearch/advanced" title="Advanced Search">Advanced Search</a></li>
33
- <?php endif; ?>
34
- </ul>
35
-
36
- </div>
37
- <?php endif; ?>
38
- <?php if(Mage::helper('dynamicsitemap')->showCategories()): ?>
39
- <div class="sitempan">
40
- <h2 class="smh2">Our Categories</h2>
41
- <?php $_helper = Mage::helper('catalog/category') ?>
42
- <?php $_categories = $_helper->getStoreCategories() ?>
43
- <?php if (count($_categories) > 0): ?>
44
- <ul class="sitecatul">
45
- <?php foreach($_categories as $_category): ?>
46
- <?php //echo $_category->isEnabled(); ?>
47
- <li class="cat">
48
- <a href="<?php echo $_helper->getCategoryUrl($_category) ?>" title="<?php echo $_category->getName() ?>"><strong class="strongsm"><?php echo $_category->getName() ?></strong></a>
49
- <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>
50
- <?php $_subcategories = $_category->getChildrenCategories() ?>
51
- <?php if (count($_subcategories) > 0): ?>
52
- <ul>
53
- <?php foreach($_subcategories as $_subcategory): ?>
54
- <?php $_nextcategory = Mage::getModel('catalog/category')->load($_subcategory->getId()) ?>
55
- <?php $_nextsubcategories = $_nextcategory->getChildrenCategories() ?>
56
- <li>
57
- <a href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>" title="<?php echo $_subcategory->getName() ?>">
58
- <?php echo $_subcategory->getName() ?>
59
- </a>
60
- <?php if (count($_nextsubcategories) > 0): ?>
61
- <ul>
62
- <?php foreach($_nextsubcategories as $_nextsubcat): ?>
63
- <li>
64
- <a href="<?php echo $_helper->getCategoryUrl($_nextsubcat) ?>" title="<?php echo $_subcategory->getName() ?> - <?php echo $_nextsubcat->getName() ?>">
65
- <?php echo $_nextsubcat->getName() ?>
66
- </a>
67
- </li>
68
- <?php endforeach; ?>
69
- </ul>
70
- <?php endif; ?>
71
- </li>
72
- <?php endforeach; ?>
73
- </ul>
74
- <?php endif; ?>
75
- </li>
76
- <?php endforeach; ?>
77
- </ul>
78
- <?php endif; ?>
79
- </div>
80
- <?php endif; ?>
81
  </div>
1
+ <div class="ones-column">
2
+ <div class="sitempan">
3
+ <?php if(Mage::helper('dynamicsitemap')->showCMS() || Mage::helper('dynamicsitemap')->showXMLSitemap()): ?>
4
+ <h2 class="smh2">Our Main Site Pages</h2>
5
+ <ul class="siteul">
6
+ <?php if(Mage::helper('dynamicsitemap')->showCMS()): ?>
7
+ <?php echo $this->getCreareCMSPages(); // prints out our cms page ?>
8
+ <?php endif; ?>
9
+ <?php if(Mage::helper('dynamicsitemap')->showXMLSitemap()): ?>
10
+ <?php $sitemap = Mage::getModel('sitemap/sitemap')->load(1); ?>
11
+ <?php $sitemapfilename = $sitemap->getSitemapFilename(); ?>
12
+ <?php if($sitemapfilename != ""): ?>
13
+ <li><a href="<?php echo Mage::getBaseUrl().$sitemapfilename; ?>" title="XML Sitemap">XML Sitemap</a></li>
14
+ <?php endif; ?>
15
+ <?php endif; ?>
16
+ </ul>
17
+ <?php endif; ?>
18
+ <?php if(Mage::helper('dynamicsitemap')->showAccount() || Mage::helper('dynamicsitemap')->showContact()): ?>
19
+ <ul class="siteul">
20
+ <?php if(Mage::helper('dynamicsitemap')->showContact()): ?>
21
+ <li><a href="<?php echo Mage::getBaseUrl(); ?>contacts" title="Contact">Contact</a></li>
22
+ <?php endif; ?>
23
+ <?php if(Mage::helper('dynamicsitemap')->showAccount()): ?>
24
+ <?php
25
+ if($this->helper('customer')->isLoggedIn()) {
26
+ echo '<li><a href="'.Mage::getBaseUrl().'customer/account/index/" title="Account">Account</a></li>';
27
+ echo '<li><a href="'.Mage::getBaseUrl().'customer/account/logout/" title="Log Out">Log Out</a></li>';
28
+ } else {
29
+ echo '<li><a href="'.Mage::getBaseUrl().'customer/account/" title="Register/Log In">Register/Log In</a></li>';
30
+ }
31
+ ?>
32
+ <li><a href="<?php echo Mage::getBaseUrl(); ?>catalogsearch/advanced" title="Advanced Search">Advanced Search</a></li>
33
+ <?php endif; ?>
34
+ </ul>
35
+ <?php endif; ?>
36
+ </div>
37
+ <?php if(Mage::helper('dynamicsitemap')->showCategories()): ?>
38
+ <div class="sitempan">
39
+ <h2 class="smh2">Our Categories</h2>
40
+ <?php $_helper = Mage::helper('catalog/category') ?>
41
+ <?php $_categories = $_helper->getStoreCategories() ?>
42
+ <?php if (count($_categories) > 0): ?>
43
+ <ul class="sitecatul">
44
+ <?php foreach($_categories as $_category): ?>
45
+ <?php //echo $_category->isEnabled(); ?>
46
+ <li class="cat">
47
+ <a href="<?php echo $_helper->getCategoryUrl($_category) ?>" title="<?php echo $_category->getName() ?>"><strong class="strongsm"><?php echo $_category->getName() ?></strong></a>
48
+ <?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>
49
+ <?php $_subcategories = $_category->getChildrenCategories() ?>
50
+ <?php if (count($_subcategories) > 0): ?>
51
+ <ul>
52
+ <?php foreach($_subcategories as $_subcategory): ?>
53
+ <?php $_nextcategory = Mage::getModel('catalog/category')->load($_subcategory->getId()) ?>
54
+ <?php $_nextsubcategories = $_nextcategory->getChildrenCategories() ?>
55
+ <li>
56
+ <a href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>" title="<?php echo $_subcategory->getName() ?>">
57
+ <?php echo $_subcategory->getName() ?>
58
+ </a>
59
+ <?php if (count($_nextsubcategories) > 0): ?>
60
+ <ul>
61
+ <?php foreach($_nextsubcategories as $_nextsubcat): ?>
62
+ <li>
63
+ <a href="<?php echo $_helper->getCategoryUrl($_nextsubcat) ?>" title="<?php echo $_subcategory->getName() ?> - <?php echo $_nextsubcat->getName() ?>">
64
+ <?php echo $_nextsubcat->getName() ?>
65
+ </a>
66
+ </li>
67
+ <?php endforeach; ?>
68
+ </ul>
69
+ <?php endif; ?>
70
+ </li>
71
+ <?php endforeach; ?>
72
+ </ul>
73
+ <?php endif; ?>
74
+ </li>
75
+ <?php endforeach; ?>
76
+ </ul>
77
+ <?php endif; ?>
78
+ </div>
79
+ <?php endif; ?>
 
80
  </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Creare_DynamicSitemap</name>
4
- <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,11 +16,13 @@ This sitemap will also include a link to your XML sitemap if you have it install
16
  The purpose of this extension is to make sure that your categories are indexed correctly as well as making your website more user-friendly.&#xD;
17
  &#xD;
18
  We have updated this extension to allow for the admin to change settings in the config area of the dashboard.</description>
19
- <notes>Updated to work on 1.4+ with admin configuration.</notes>
 
 
20
  <authors><author><name>Robert Kent</name><user>auto-converted</user><email>magento@creare.co.uk</email></author></authors>
21
- <date>2013-01-24</date>
22
- <time>15:12:53</time>
23
- <contents><target name="magelocal"><dir name="Creare"><dir name="DynamicSitemap"><dir name="Block"><file name="Dynamicsitemap.php" hash="cd8f7624af59290922a6ae913bf1083f"/></dir><dir name="Helper"><file name="Data.php" hash="856282fac51bdd86f56886547cd55411"/></dir><dir name="controllers"><file name="IndexController.php" hash="2d7d6ff70f70e00c17bfbc3d9305671a"/></dir><dir name="etc"><file name="config.xml" hash="c1400adf54c97ffd01c94a9b35bff16b"/><file name="system.xml" hash="b6b823534571c11dcd3abff1a7e50582"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="creare"><dir name="dynamicsitemap"><file name="sitemap.phtml" hash="d26267d1306073d8f323c1681e447f7f"/></dir></dir></dir><dir name="layout"><file name="creare_dynamicsitemap.xml" hash="0480832b0f7b5a1c5c5cd3e128289dfd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_DynamicSitemap.xml" hash="b73c659870f8926bb4c59b1e9000ae2b"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="creare"><dir name="css"><file name="dynamicsitemap.css" hash="85d89bf92ecf5e084e2c0b9ae7f271f6"/></dir></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Creare_DynamicSitemap</name>
4
+ <version>2.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
16
  The purpose of this extension is to make sure that your categories are indexed correctly as well as making your website more user-friendly.&#xD;
17
  &#xD;
18
  We have updated this extension to allow for the admin to change settings in the config area of the dashboard.</description>
19
+ <notes>Updated to work on 1.4+ with admin configuration.&#xD;
20
+ &#xD;
21
+ More fixed for store view and is_active CMS pages</notes>
22
  <authors><author><name>Robert Kent</name><user>auto-converted</user><email>magento@creare.co.uk</email></author></authors>
23
+ <date>2013-05-20</date>
24
+ <time>10:40:57</time>
25
+ <contents><target name="magelocal"><dir name="Creare"><dir name="DynamicSitemap"><dir name="Block"><file name="Dynamicsitemap.php" hash="f3673ec07a7edb270b983e10279d0aee"/></dir><dir name="Helper"><file name="Data.php" hash="856282fac51bdd86f56886547cd55411"/></dir><dir name="controllers"><file name="IndexController.php" hash="2d7d6ff70f70e00c17bfbc3d9305671a"/></dir><dir name="etc"><file name="config.xml" hash="a25f0021efb9ef409ec9b8e5bd8d4eb9"/><file name="system.xml" hash="b6b823534571c11dcd3abff1a7e50582"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="creare"><dir name="dynamicsitemap"><file name="sitemap.phtml" hash="0326a0f50ae2c08ab89600aefb49997e"/></dir></dir></dir><dir name="layout"><file name="creare_dynamicsitemap.xml" hash="0480832b0f7b5a1c5c5cd3e128289dfd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_DynamicSitemap.xml" hash="b73c659870f8926bb4c59b1e9000ae2b"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="creare"><dir name="css"><file name="dynamicsitemap.css" hash="85d89bf92ecf5e084e2c0b9ae7f271f6"/></dir></dir></dir></dir></dir></target></contents>
26
  <compatible/>
27
  <dependencies/>
28
  </package>