Duplicate elements after clicking in a repeater list item - duplicates

I've an issue after clicking in repeater list item, I get two items in the detail page instead of one element.
This repeater is for Booking elements and I've added the follow transformation: "Transformation" and "Selected item transformation".
The "Selected item transformation" is applied but I get two elements in the page after apply this transformation.
I tried to add a data list and instead of to get two elements after clicking on an element I get four.
I'm new in Kentico maybe it is a configuration issue.
Below I detail the configuration for the repeater web part:
Content/Path:/Events/%
Content filter/Page types: CMS.BookingEvent
Content filter/Category name: {%SiteContext.CurrentCategory.CategoryName#%}
Do you have any idea about what can be the problem?
If you need more information please let me know and I'll send you.

You can check following below things
Does the listed page & detail page uses same page template (is it inherited)?
Need to check Selected item transformation, is it setup right?.
For testing you can remove category filter and then check.
Make sure are you using <%# GetDocumentUrl() %> in list page Transformation
Thanks

Does the listed page uses same page template (is it inherited)? Do you have just one repeater on that page?
The selected item transformation renders on target page (detail of listed page) but the page needs to use same page template (or inherit the one that is on parent page listing page)
Alternatively, don't specify selected transformation and make the repeater on target page to display just its properties.

Check list and details pages. In your case details page should inherit template from list page.
Your repeater is responsible for showing list and details, so make sure there is no extra web part (another repeater or any other viewer) that shows details only.
Also try to check Hide on child pages setting in your repeater - this will help you to figure out if repeated renders 2 details (in case no details shows now) or there is another web part for details (in case only one item details appear now).

This page is using the selected item transformation correct? And this happens when you are navigating to the event page (/Event/CustomEvent1)?
Does this happen for every event? Does the event page url have any special characters in it? I have had an issue before if the page has an _ in the name and url, it will break the repeater. This was fixed in a hotfix in K9.

If you are still running with this issue, I'd suggest to remove SelectedItemTransformation and display detailed content on specific document i.e. /Event/CustomEvent1. You can use either repeater for read current document only and set detailed Transformation in "Transformation" property itself DON't use "SelectedItemTransformation" in this case.

Thanks so much for all the answers, they were pretty useful for me.
The problem was related with the inherited template. In my "Listed page" on template tab I chose the option "Clone template as ad-hoc". I've checked in the detail pages that the template option was in "Inherit from parent".
I realized too that in the root template which I've used in the "Listed page" there were a repeater, then I removed it and the problem was fixed.
Thanks so much again.
Kind regards,
Max

Related

Multiple Alias Routes to base Razor Page

I'm pretty new to Razor Pages, and I'm trying to figure out how to replicate routing I have in my current Angular Page.
I have a base razor page that will be populated with different data depending on which parameter is passed to it. This is easy enough, and I know how to do this. However, my problem is in the routing because I want to be able to pass a readable parameter that is based off of the base URL. For example, I want to be able to do:
https://myURL/Band1
https://myURL/Band2
and have both point to the same page (but not the Index Page), consume the parameter "Band1" or "Band2" to display the associated information.
I understand how to consume the parameter, and how to get data, what I'm not clear on is how to do this routing based on the base URL. I can see how I'd do it if it were https://myURL/b/Band1 since I'd make a "b" page and accept parameters.
But how does one do this without that intervening segment of the URL? I need to be able to do this to not break existing links.
Thanks!
The docs for Razor Pages suggest you can create a page named Index.cshtml, which will act as the default where no page is specified in the URL.
Edit
If you want to preserve the parameterless index page, but have your page take its place when the additional URL part is provided, try the following in your page:
#page "/{bandName}"

How do I transclude part of page while maintaining pagename variable?

I currently have a template that includes the magic variable PAGENAME and FULLPAGENAME which is then applied to a large number of pages with more detailed information on each item. I would like to transclude a part of those pages to another single summary page while maintaining PAGENAME of the parent page.
I have tried to use subst:FULLPAGENAME, however all that does is display "template:*Thepage*" on all instances where the template is called.
I have also tried to use the includeonly tag, but it doesn't seem to want to work very well.
I'm relatively new to mediawiki, any help would be appreciated.
You don't. You can have a transclusion change of arbitrary length; the software has no way of figuring out which link in that chain you need the pagename for.

Changing page title as it appears in MediaWiki category

I've been trying to use DEFAULTSORT to sort pages based on a template parameter instead of the page title. This is how it appears at the top of the template:
{{DEFAULTSORT:{{{Username}}}}}
This is how it appears after the argument is transcluded:
{{DEFAULTSORT:d3xus}}
It would be nice for it to appear in categories as d3xus and not D3xus. There's no change in how the page is sorted because they both begin with the same symbol. Using an extension or magic word, is it possible to change how a page appears when viewed in a category? DEFAULTSORT only changes how the page is sorted with respect to other pages in the same category, but it does not change the page title in the category.
That's actually impossible without a bigger change in the code. There is a task for it in Wikimedia's bug/feature tracking software Phabricator: T19212, but it's actually stalled :(
There is no such thing. If you want to change the page title regardless where it is displayed, you can use $wgCapitalLinks or {{DISPLAYTITLE}}.
Actually it seems there is such a thing: Extension:Semantic Title. It is very hacky though (and you need to install Semantic MediaWiki).
Try this:
Method 1: Add to your MediaWiki site: {{DISPLAYTITLE:d3xus}} and [[Category:d3xus]].
Method 2: https://www.mediawiki.org/wiki/Extension:Semantic_Title

Headings created inside of a template

I have a number of templates that create headings based on a formula. I am wondering if there is anyway to create an "edit" link that will take you directly to that section? The way that it currently works, the edit link takes you to editing the template itself. Could I possibly create a customized link that would keep you on the page and take you to right part?
Here is some sample code to help clear things up...
Template:Head:
==={{{1}}}===
This is a heading titled "{{{1}}}"
Test Page:
=Section 1=
{{head|1.1}}
{{head|1.2}}
{{head|1.3}}
=Section 2=
{{head|2.1}}
{{head|2.2}}
{{head|2.3}}
At the moment, if I want to edit the information for template "2.3", I have to edit all of section 2. (Note that for this example, that isn't a big deal. For the actual templates I am working with on my site, the templates have dozens of parameters and there are sometimes 10 or more in a section.)
Bottom line, is there way to create a custom edit link inside of the {{head}} template that would take you directly to editing the templates call on the page "Test Page"? Hope that makes sense.
Edit: Is there perhaps a way to make use of "anchor" tags? Can anchors be passed in to the URL?
To restate your problem, when you transclude a section heading the header isn't treated as being part of the destination page, so the edit link takes you back to the source. So you need a separate container for the template in order to edit it individually, and a complete section is the smallest editable container.
The only way I can think of doing this is using subpages (or virtual subpages if you don't have that ennabled in this namespace, doesn't change anything). So instead of placing {{head|1.1}} on MyPage, put it on MyPage/Subpage1 and then transclude that into MyPage in the usual way ({{:MyPage/Subpage1}}).
{{head}} can then include a custom edit link to the template input by using HTML heading tags (<h2> is equal to ==, etc.) to suppress the standard edit link and then use one of these templates (probably {{ed right}}) to create a custom edit link pointing to MyPage/Subpage1.
The way to create anchors in Mediawiki, by the way, is to use a <span id="name"/> tag, but that doesn't create a container that can be edited (or at least, not that I've been able to work out through URL tinkering).
I'm pretty sure there's no way to do that. As far as MediaWiki's section editing feature is concerned, the only thing that begins a new section is a line of the form:
=== Some text here ===
with the number of = signs determining the level of the heading. There's no way to get MediaWiki to let you edit any segment of the document that doesn't begin and end with such a line (or the beginning or end of the page).
Well, OK, I'm sure you technically could do it with an extension, in the sense that you can do anything with a MediaWiki extension. All you'd need to do is provide some way (e.g. a special parameter in an edit URL) for to user to indicate "I want to edit this template", then extract the template from the wikitext, present it to the user for editing, and write the result back into the page text over the original.
The tricky part will be extracting the template from the page source. (Finding and replacing templates on a page is a fairly common task for MediaWiki bot writers, so you might want to look for ideas there.) Whatever method you end up using for that, there will probably be edge cases where you need to give up and tell the user "Sorry, but I can't figure out how that template is transcluded here."

Drupal 7 navigation based on URL

Does anyone know if it's possible to extract the URL and if a value is found within the URL to display/hide something?
For instance, if I have a navigation bar that I want to only display for pages that contain 'copier' and I have URL aliases setup, can I setup Views module (or something like that) to check the URL for the 'copier' value and if it's found to display the navigation? If so, how would I go about doing that?
I know there can't be duplicate URL aliases but if say I had them as:
node/Copier
node/Copier-training
Could I check that URL and see if copier is present, and if it is display the navigation assoicated with copier?
I'm not really familiar with Views.
Not sure if this answers your question or not, the mention of Views is throwing me off a bit, but I believe all you need work with is a Block. You put your navigation into the Block, and then set the "Visilibity Settings" to be
node/*copier*
and set "Show block on specific pages" to "Only the listed pages".
This would then show the block on any page with copier in the URL, however this would only work for URLs of the type node/blahblahblah, if you wanted it to also show on say a URL such as blog/copier-training you would have to add another line to the Visibility Settings of the Block
node/*copier*
blog/*copier*
and also for any subsequent drill-downs also, for instance say blog/richie/copier-training would require
node/*copier*
blog/*copier*
blog/richie/*copier*
alternatively you could write a whole load of wildcarded options that go as deep as your site URLs may go
*/*copier*
*/*/*copier*
*/*/*/*copier*
ad infinitum
which is probably better...
If you do want to show a View within the Block you can use the following PHP
<?php
//load the view by name
$view = views_get_view('sample_view');
//output the view
print views_build_view('embed', $view);
?>
Hope this helped.