rash Posted April 12, 2018 Posted April 12, 2018 @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.
Mike Rockett Posted April 15, 2018 Author Posted April 15, 2018 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.
rash Posted April 16, 2018 Posted April 16, 2018 @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.)
Mike Rockett Posted April 16, 2018 Author Posted April 16, 2018 @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: 1
rash Posted April 16, 2018 Posted April 16, 2018 @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. 1
Mike Rockett Posted April 18, 2018 Author Posted April 18, 2018 @rash Great, I figured it might be that. I'll push the change and bump as soon as I can.
Mike Rockett Posted April 18, 2018 Author Posted April 18, 2018 I've bumped to 0.4.0 RC3 on the repo. 1
rash Posted April 18, 2018 Posted April 18, 2018 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')?
Mike Rockett Posted April 18, 2018 Author Posted April 18, 2018 @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').
Robin S Posted April 18, 2018 Posted April 18, 2018 (edited) 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 April 18, 2018 by Robin S Forgot the ->type 1
Mike Rockett Posted April 18, 2018 Author Posted April 18, 2018 Thanks @Robin S, I'll give that a try.
adrian Posted July 4, 2018 Posted July 4, 2018 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!
adrian Posted July 5, 2018 Posted July 5, 2018 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! 1
Mike Rockett Posted July 7, 2018 Author Posted July 7, 2018 Hey @adrian - thanks for pointing this out. Both are valid points, so I'll try look into it this weekend. 3
Mike Rockett Posted July 14, 2018 Author Posted July 14, 2018 The module has been moved to GitLab: https://gitlab.com/rockettpw/seo/markup-sitemap I have tagged 0.4.1-RC3, but have not yet updated it in the modules directory. Need to fire up the old laptop to get credentials for that. 3
Mike Rockett Posted July 14, 2018 Author Posted July 14, 2018 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. ? 2
adrian Posted July 17, 2018 Posted July 17, 2018 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
Nick Belane Posted August 29, 2018 Posted August 29, 2018 (edited) Deleted, see below. Edited August 29, 2018 by Nick Belane Didn't use the quote as below
Nick Belane Posted August 29, 2018 Posted August 29, 2018 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.
Mike Rockett Posted September 24, 2018 Author Posted September 24, 2018 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. 1
Mike Rockett Posted September 24, 2018 Author Posted September 24, 2018 @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.
Mike Rockett Posted September 24, 2018 Author Posted September 24, 2018 @Nick Belane – I've pushed JL 1.5.50, which should resolve the logging issue. I see there was already a check for the other sitemap module, just never accounted for my own after it was released. 1
adrian Posted September 24, 2018 Posted September 24, 2018 @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 ?
Mike Rockett Posted September 24, 2018 Author Posted September 24, 2018 @adrian – I see what you're saying now; thought about it the wrong way around. With that said, surely include=hidden is enough?
adrian Posted September 24, 2018 Posted September 24, 2018 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now