Jump to content
Pete

Module: XML Sitemap

Recommended Posts

I updated my client's website with new version 1.0.5 of this module and my sitemap.xml doesn't work anymore, when I launch http://www.fmmhindusociety.com/sitemap.xml, it give me 404 error so I reverted back to version 1.0.3 which work as expected.

Hosting is on windows platform with godaddy, just for your info.

Share this post


Link to post
Share on other sites

Ah, I will have a look at it tomorrow again :(

Share this post


Link to post
Share on other sites
I updated my client's website with new version 1.0.5 of this module and my sitemap.xml doesn't work anymore, when I launch http://www.fmmhindusociety.com/sitemap.xml, it give me 404 error so I reverted back to version 1.0.3 which work as expected.

Hosting is on windows platform with godaddy, just for your info.

Have you LanguageLocalizedURL module installed? I guess not. I can't see where that 404 is coming from. I'm currently trying around and it works.

If you don't have language urls installed there's no need to update to 1.0.5 already. Sorry for the confusion I created here.

Share this post


Link to post
Share on other sites

Soma, I don't have LanguageLocalizedURL module installed. I already reverted to v1.0.3 which I had before.

Just wondering if I want to install latest & greatest XMLSitemap module then I need to have LanguageLocalizedURL module installed? correct? I think if its then probably Pete needs to update installation instructions with dependencies of other modules.

Share this post


Link to post
Share on other sites

No there is no dependencies it just looks if it is installed. Theres no other significant changes.

Share this post


Link to post
Share on other sites

Yeah its the 404 page. So no error.

The only thing I can imagine is that this code doesn't work for you and so since sitemap.xml isnt a page it shows 404 page. I don't know why it wouldn't work.

if (strpos($_SERVER['REQUEST_URI'],  '/sitemap.xml') !== FALSE) {
    $this->addHookAfter("Page::render",$this,"renderSitemap");
}

Share this post


Link to post
Share on other sites

This has now been bumped to 1.0.6 as I missed a change from Soma. Not sure if it will fix your issue though!

Share this post


Link to post
Share on other sites

Pete. There's a missing $langname = ''; #36, the sitemap won't work if debug mode enabled, as the markupcache uses $langname and throws a warning that will give a header already sent error.



SOmehow fmgujju seems another problem as if it shows a 404 page, which means the modules doesn't get executed at all or the most likely the init code strpos check doesn't hold true for some reason (the only I changed)

Share this post


Link to post
Share on other sites

Added and committed that line - thanks.

Yep - no idea what the 404 issue is as I compared the strpos and it should just work as far as I can tell.

Share this post


Link to post
Share on other sites

It's not working with v1.0.6 either. Because I have installed PW on windows platform that's why it may not be working.I have rollback to v1.0.3 again.

Share this post


Link to post
Share on other sites

I made some changes to get rid of the 404 problem and changes some minor stuff to then work with LanguageLocalizedURL module too.

fmgujju

could you please take that code https://github.com/somatonic/MarkupSitemapXML/blob/master/MarkupSitemapXML.module and test if it solves your issue before pete accepts the pull request? Thanks

  • Like 1

Share this post


Link to post
Share on other sites

hi pete,

thanks for your module. just wanted to ask if there is a way to update the sitemap as the site evolves (i.e. new pages are added)?

best, christoph

Share this post


Link to post
Share on other sites

@totoff, it keeps the cache for an hour and then re-caches the entire sitemap so it does 24 updates a day to keep current on even the most active sites.

@Georgson - no problem!

  • Like 1

Share this post


Link to post
Share on other sites

Pete, just a heads-up that I sent you a pull request regarding Multisite support and a pile of other changes I thought were necessary/useful.. :)

Edit: as an afterthought, should probably have sent those as separate pull requests. Not familiar enough with GitHub yet. I hope there's some way to choose which commits you're willing to merge (if any.)

Also: didn't read this thread properly before making changes, so I've managed to miss all this 404-related stuff.

One of those commits would change hook from Page::render to ProcessPageView::pageNotFound, which shouldn't break anything (except that it changes slightly those cases where sitemap gets rendered, which was exactly my intention) but that might be slightly dangerous still. Works OK on those platforms where I've had the chance to test it, but that may not be good enough yet.

Edited by teppo
  • Like 1

Share this post


Link to post
Share on other sites

Hi there - 

I'm having a little trouble getting this to work. I'm getting the same error that was mentioned earlier, namely this:

Error: Exception: Unable to create path: /f5/thesharktankproducts/public/site/assets/cache/MarkupCache/MarkupSitemapXML/ (in /f5/thesharktankproducts/public/wire/core/CacheFile.php line 62)
 

My site/assets/cache folder's permissions are currently set to 777.

I also uninstalled Markup Cache and Markup XML, then reinstalled them (Cache first, and newest version of XML), with no luck.

I'm running PW 2.3.0.

I have what I think is the PW default site-map available here: http://thesharktankproducts.com/site-map/ but that's not readable by Google Webmaster Tools.

I would be very grateful for any insights. Thanks!

Share this post


Link to post
Share on other sites

Hi there - 

I'm having a little trouble getting this to work. I'm getting the same error that was mentioned earlier, namely this:

Error: Exception: Unable to create path: /f5/thesharktankproducts/public/site/assets/cache/MarkupCache/MarkupSitemapXML/ (in /f5/thesharktankproducts/public/wire/core/CacheFile.php line 62)
 

My site/assets/cache folder's permissions are currently set to 777.

I also uninstalled Markup Cache and Markup XML, then reinstalled them (Cache first, and newest version of XML), with no luck.

Just to make sure: does /site/assets/cache/MarkupCache/ directory exist and if it does, is it also writable (either 777 permissions or writable by web server?)

Share this post


Link to post
Share on other sites
Just to make sure: does /site/assets/cache/MarkupCache/ directory exist and if it does, is it also writable (either 777 permissions or writable by web server?)

Yes it exists and the permission is set to 777.

Not sure if this is helpful/relevant, but I only just migrated it from my local server to the host server last night. I just copied the files to the host server, and changed the config.php file to connect to the correct server. Is this possibly something that could be causing the error?

EDIT: Just checked the XML sitemap on my local install and it is working there.

Share this post


Link to post
Share on other sites

OK, so i also just discovered I am not able to upload images. I had Filezilla set all the directories in my site to 777 and tried again with no luck. This now seems like a separate issue. Something with my host I'm guessing.

I'll start a new thread. Sorry!

Share this post


Link to post
Share on other sites

I am getting the following error after attempting to access website.com/sitemap.xml

Running ProcessWire 2.3 on local machine.

post-609-0-41969500-1370888735_thumb.png

************

EDIT: I downloaded and replaced the *.module with the latest one from github, still error persists.

I'll uninstall in the meantime

:)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
    • By EyeDentify
      Hello There Guys.

      I am in the process of getting into making my first modules for PW and i had a question for you PHP and PW gurus in here.

      I was wondering how i could use an external library, lets say TwitterOAuth in my PW module.
      Link to library
      https://twitteroauth.com/

      Would the code below be correct or how would i go about this:
      <?PHP namespace ProcessWire; /* load the TwitterOAuth library from my Module folder */ require "twitteroauth/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; class EyeTwitter extends WireData,TwitterOAuth implements Module { /* vars */ protected $twConnection; /* extend parent TwitterOAuth contructor $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret); */ public function myTwitterConnection ($consumer_key, $consumer_secret, $access_token, $access_token_secret) { /* save the connection for use later */ $this->twConnection = TwitterOAuth::__construct($consumer_key, $consumer_secret, $access_token, $access_token_secret); } } ?> Am i on the right trail here or i am barking up the wrong tree?
      I don´t need a complete solution, i just wonder if i am including the external library the right way.
      If not, then give me a few hint´s and i will figure it out.

      Thanks a bunch.

      /EyeDentify
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
      As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend
       

×
×
  • Create New...