Hello ;) Here is my template. It uses DPL and it's supposed to display the pictures included in the category of the same page name where the template is included. I tested it here, but it doesn't display anything. Any help is very welcomed.
Hello ;) Here is my template. It uses DPL and it's supposed to display the pictures included in the category of the same page name where the template is included. I tested it here, but it doesn't display anything. Any help is very welcomed.
So, correct me if I am wrong. It looks like you want each gallery to search for categories that contain either the page or subpage name. As long as those are the only things you are looking to search for, I don't think you need to have parameters. However, the spaces around the "/" in the page name could be problematic. Does your wiki do that for all subpages or just some? If just some, why?
As for the error, there are some extra whitespace characters at the end of that line which appear to be the cause of the error. Just remove those characters and it should be fine.
Also, there is something I forgot to mention before. The new DPL version has a different default order method; no order. If you want the images to appear in a fixed order, you will need to explicitly set the order method.
Here is a revised version given my above assumptions, the old DPL ordering, and the assumption of no spaces around "/" in the page name. Once you let me know about the spaces in the page name, I can try to adjust it accordingly to your wiki's conventions.
{{#dpl: |noresultsheader= |namespace=Fichier |categorymatch={{#replace:{{PAGENAMEE}}|/|{{!}}}} |notcategory=Pochettes |format=«gallery type="slideshow" hideaddbutton="true"»,%PAGE%\n,,«/gallery» |allowcachedresults=true |ordermethod=titlewithoutnamespace }}
Spaces around the "/" is to show its not a subpage but the topic contains a "/". Here is a real subpage. The gallery is not always depending on the page name and my attempt was to be able to use it on user pages as well.
Oh, I didn't know it was updated, it explains a lot ;)
Regarding subpages, adding spaces before/after the "/" doesn't prevent that. The page with the issue is still a subpage whether it was meant to be that way or not. You can tell because of the breadcrumb links below the title. If you are trying to show that the page is about a subtopic of another page but don't want it to be a subpage, then you will need to choose a different symbol to use.
Yes, it doesn't and it's not a problem.
Do you mean dpl don't take variables?
No, it can take variables. I am just trying to simplify it so you don't have to. That is why I am trying to understand what their purpose is. From the examples you gave, it seems like the parameters are always just the different parts of the page name (separated by "/"). Is that always the case or are there cases where you add names that aren't part of the actual page name?
I see. Well, in that case, you can have a version that does the auto-splitting for you and still takes parameters.
{{#dpl: |noresultsheader= |namespace=Fichier |categorymatch={{#replace: {{PAGENAMEE}} | / | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | _/ | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | /_ | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | _/_ | {{!}}}}{{#if: {{{1|}}} | {{!}}{{{1}}}}}{{#if: {{{2|}}} | {{!}}{{{2}}}}}{{#if: {{{3|}}} | {{!}}{{{3}}}}}{{#if: {{{4|}}} | {{!}}{{{4}}}}}{{#if: {{{5|}}} | {{!}}{{{5}}}}} |notcategory=Pochettes |format=«gallery type="slideshow" hideaddbutton="true"»,%PAGE%\n,,«/gallery» |allowcachedresults=true |ordermethod=titlewithoutnamespace }}
This version should be able to automatically grab categories for each subpage level assuming there is no more than a single space between the "/" and the other characters. It also has 5 parameters you can use to enter terms not part of the subpage name.
Great, like this it works ;)
I tried to tweak it a little in order to not add pictures from the page name category when parameters are added, but other pictures which doesn't belong to the selected categories are at the end of the slide.
So, you want to operate either using the page name or parameters but not both? Then give this a try.
{{#dpl: |noresultsheader= |namespace=Fichier |categorymatch={{#if: {{{1|}}} | {{{1}}}{{#if: {{{2|}}} | {{!}}{{{2}}}{{#if: {{{3|}}} | {{!}}{{{3}}}{{#if: {{{4|}}} | {{!}}{{{4}}}{{#if: {{{5|}}} | {{!}}{{{5}}}}}}}}}}} | {{#replace: {{PAGENAMEE}} | / | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | _/ | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | /_ | {{!}}}}{{!}}{{#replace: {{PAGENAMEE}} | _/_ | {{!}}}}}} |notcategory=Pochettes |format=«gallery type="slideshow" hideaddbutton="true"»,%PAGE%\n,,«/gallery» |allowcachedresults=true |ordermethod=titlewithoutnamespace }}
And it works, thanks a lot ;)