Jump to content

Recommended Posts

@Mike Rockett It seems as if I'm unable to include images in the sitemap. Besides that, the module is working just fine. I can find the option to exclude images (page-based) but neither the one to include them, nor do they get included automatically. I'm using only one images field in my template and the page is multilingual. Any hints what I'm doing wrong?

Thanks.

Share this post


Link to post
Share on other sites

Hi @rash -- did you add the image field in via the module's config? This is basically a way to globally add specific image fields in one swoop, and then the exclusion options are available at page-level to override.

Share this post


Link to post
Share on other sites

@Mike Rockett This is the way I would have assumed to go, unfortunately I can't find an option like the one you describe. On the module’s config page there are the following sections:

Module information
Templates with sitemap options
Templates without sitemap options
ISO code for default languages
Stylesheet
Support Development
Deinstall

Either I’m suffering from vision defects, or the mentioned option is missing.  (Or carefully hidden.)


 

Share this post


Link to post
Share on other sites

@rash, the module checks to see if any image fields are available to your installation. To be more precise, the check is specific to FieldtypeImage, which might be where the problem is coming in... I'm not sure if there are other Image modules that extend FieldtypeImage out there (and if so, if you're using one). On my side though, a fresh install of PW with the latest MarkupSitemap and an image field added in results in the config showing the applicable selector:

image.thumb.png.12d3036fa66f579e804a117047785c38.png

  • Like 1

Share this post


Link to post
Share on other sites

@Mike Rockett Thanks for your fast reply. It looks as if we’re getting closer: my images are of fieldtype CroppableImage3, resulting from the popular module with the same name. Do you think I could just change the field type where the check happens? Or extend the range of possible field types? I’m no big fan of module hacks, but in this case I could live with it. Would you mind to reveal the exact check location?

Update: I’ve got the job done now – much easier than expected. Just in case somebody faces the same problem: in /site/modules/MarkupSitemap/MarkupSitemapConfig.php in line 90 I changed

if ($imageFields = $this->fields->find('type=FieldtypeImage') and $imageFields->count) {

to

if ($imageFields = $this->fields->find('type=FieldtypeImage|FieldtypeCroppableImage3') and $imageFields->count) {

to extend the range of considered field types. The option select appeared and everything works perfectly now. Another thanks for your help.

  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, Mike Rockett said:

I've bumped to 0.4.0 RC3 on the repo.

@Mike Rockett Fine, thank you. Just a question for future generations: As I presume that there are (or will be) several different images field types, wouldn’t it be better to keep the check more generic? The way I’ve suggested is working for me, but has the big drawback that every single field type must be explicitely listed – and you might never catch all of them. So is there a syntax for (in plain words) find('type=fields that are somehow managing images')?

Share this post


Link to post
Share on other sites

@rash You're quite right. I did think about it earlier, but not 100% sure how to go about it... Would be awesome if we could do something like find('extends=FieldtypeImage').

Share this post


Link to post
Share on other sites
1 hour ago, Mike Rockett said:

Would be awesome if we could do something like find('extends=FieldtypeImage')

The next best thing...

$imageFields = [];
foreach($this->fields as $field) {
   if($field->type instanceof FieldtypeImage) $imageFields[] = $field;
}

 

Edited by Robin S
Forgot the ->type
  • Like 1

Share this post


Link to post
Share on other sites

Hi @Mike Rockett

Thanks for this module! I was just looking at the module settings and noticed that there is an array of setting for every page of the site that has been saved since this module was installed. Any chance you could not add the:

"o1029":{
"priority":false,
"excludes":{
"images":false,
"page":false,
"children":false
}
}

for each page, unless one of the options is true?

Otherwise on a large site over time, this is going to become huuuge! And especially given that for most pages, I doubt anyone is touching these settings.

Thanks!

Share this post


Link to post
Share on other sites

Sorry @Mike Rockett - another question for you. What do you think about supporting the finding of pages that are children of hidden / unpublished pages? Just because a parent isn't viewable doesn't mean the children aren't.

Thanks!

  • Like 1

Share this post


Link to post
Share on other sites

I've updated in the modules directory.
Don't have time at the moment to look at this – if its needed urgently, please submit a merge request. 🙂

  • Like 2

Share this post


Link to post
Share on other sites

Thanks @Mike Rockett for the fix to prevent saving of unnecessary settings - that will be a huge improvement.

Regarding the hidden/unpublished parents preventing children from appearing in the sitemap, isn't it simply a matter of adding include=all to the children() selector on this line: https://gitlab.com/rockettpw/seo/markup-sitemap/blob/142c86571aca9cb80569398b94d69a73676272b9/src/Traits/BuilderTrait.php#L190

 

Share this post


Link to post
Share on other sites
On 3/29/2018 at 10:30 AM, maxf5 said:

I am using the module on various multilingual sites and it's working fine!

When you have Jumplinks installed it sometimes hits an 404 on /sitemap.xml even though the link/sitemap is working.
Do you have to create an extra page and template  (xml header) for it?
 

I have the same "issue".
sitemap.xml is working properly but throws a 404 in jumplinks.

Share this post


Link to post
Share on other sites

Hi guys, super sorry for the delay here.

@adrian – Will have a look at this now. Would likely want it to be configurable as well.

@Nick Belane – I recall noticing this as well. My initial thinking was to ignore it as the plan was to drop the 404 tab in Jumplinks and replace it with a dedicated module that works side-by-side with Jumplinks v2. That said, I just don't have the time. Haven't even managed to get around to finishing the new Jumplinks. So for the time being, I'm going to see what I can do to have the sitemap ignored from the logger.

  • Like 1

Share this post


Link to post
Share on other sites

@adrian So if I use include=hidden (I won't use all as it includes too much), I also need to exclude anything under admin, which is cool and it works, but it would mean that if a hidden parent would need to be excluded using the sitemap options. With that said, including hidden and unpublished pages will be configurable as a single config option.

Root
  …
  Hidden Page (would be included by default if the option is enabled, so it would need to be turned off in options)
    Child 1 (included)
    Child 2 (included)
  …

Would this be suitable?

PS, I had hell with the File Compiler - not sure if anything there has changed of late, but my traits were just not being read properly. Any changes I made didn't take effect, even after clearing the cache. For now, I'm moving everything into the main module file except for the field builder.

Share this post


Link to post
Share on other sites

@Mike Rockett - I'll admit I haven't investigated things properly at all, but I guess I don't understand why you can't use include=all and then have $page->viewable check to see if the page should be included in the sitemap or not.

I don't really understand why this option needs to be configurable. I am not talking about having actual hidden or unpublished pages in the sitemap, just allowing for published/ not hidden children of unpublished/hidden pages to be included. That is what is currently missing.

Does that make sense, or am I missing your point completely ?

Share this post


Link to post
Share on other sites
3 minutes ago, Mike Rockett said:

@adrian – I see what you're saying now; thought about it the wrong way around. With that said, surely include=hidden is enough?

Well I do sometimes have an unpublished page as a parent for published and viewable children. Is there any reason to exclude unpublished - so long as they are not being added to the sitemap themselves, I am not sure why it matters. What's your reasoning for not wanting to include them?

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   1 member

  • Similar Content

    • By NehaPillai
      Hello Everyone, I was trying to update SEO meta title, description and meta keywords for my website in Process Wire CMS but it saving in the backend but it is not reflecting on my website, Please help me regarding this error. Please find below attached screen shot for your ref. TIA.


    • By stanoliver
      My aim is to output a very basic xml document which should be styled with a few css-styles.
      <?xml version = "1.0"?> <contact-info> <name>Donal Duck</name> <company>Superducks</company> <phone>(011) 123-4567</phone> </contact-info> How do I implement it with processwire?
    • By franciccio-ITALIANO
      Hi, we can choose the "headline" and "title" and "summery" in panel page of processwire, but we can't write the "metadecriptions" and "tags".
       I can write mdescropt and tags in templates, but I've same templates for many articles... so, how I can change mdescription and tags?

      Thanks...
    • By Leftfield
      Hi All 🙂

      How to append canonical URL to head from certain templates?

      Thanks!!!
    • By Marco Angeli
      Hi there,
      I added a ssl certificate to my site and I'd like to redirect every single http url to its new https version
      So I added this code in the .htacces file, after the RewriteEngine On :
      Redirect 301 /about https://www.mysite.it/about
      Unfortunately this is now working: I get the "too many redirects" error.
      The following code works, but it's a bulk redirection to the home page, something I don't want for SEO reasons (https://moz.com/blog/save-your-website-with-redirects😞
      RewriteCond %{HTTP_HOST} mysite\.it [NC]
      RewriteCond %{SERVER_PORT} 80
      RewriteRule ^(.*)$ https://www.mysite.it/$1 [R,L]
      Any suggestions?
×
×
  • Create New...