Jump to content

MarkupSitemap


Mike Rockett

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.

Link to comment
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.)


 

Link to comment
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
Link to comment
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
Link to comment
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')?

Link to comment
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
Link to comment
Share on other sites

  • 2 months later...

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!

Link to comment
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

 

Link to comment
Share on other sites

  • 1 month later...
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.

Link to comment
Share on other sites

  • 4 weeks later...

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
Link to comment
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.

Link to comment
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 ?

Link to comment
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?

Link to comment
Share on other sites

  • bedak changed the title to MarkupSitemap: Fatal Error after updating to 0.8.1 (PHP 8+)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...