How can I display spaces in Media Wiki Page Title but not in the URL? - mediawiki

How can I display spaces in Media Wiki Page Title but not in the URL?
Desired Result: if someone types in example.com/w/John1:1-5 then I'd like the page title on that page to show John 1:1-5.
I realize I could create a page at example.com/w/John_1:1-5, but I don't want users to have to type the underscore.
Is there a way to do this without creating a redirect?
Thanks!

You can use the DISPLAYTITLE magic word for this, e.g. {{DISPLAYTITLE:John 1:1-5}}.
$wgAllowDisplayTitle must be set to true order to use it, and $wgRestrictDisplayTitle set to false. The former enables the feature, and the latter permits more than just letter-case changes (i.e. the display title can be anything at all, even quite different from the page title).
If you want to display inbound links on other pages (i.e. you type [[John1:1-5]] but want it to display as John 1:1-5) then the Display Title extension can do that.

Related

URL to an unnamed part of a web page

I'd like to refer to a specific part of a web page which I am not the author of, and which is not tagged with the NAME attribute. The specification of the part I have in mind could be made, e.g., as the location a certain word appears, and which could be manually reached via a FIND operation. I imagine something like
http://somesite.com#search-for:foo-bar
Is there some feature in HTML allowing for this?
No.
You can only link to elements with an id and a elements with a name.

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

Semantic MediaWiki {{#ask}} - how to show source value instead "redirect name"?

I have a page(such as: Air Canada), in page, there is a property IATA, value is "AC".
Then, in Main_Page, I used:
{{#ask: [[Category:Airline]]
| ?IATA
}}
to list. (#ask is a feature in Semantic mediawiki extension)
It can work OK.
But, if I created a redirect page(AC) to "Air Canada", then, the string "AC"(listed in Main_Page) will be changed to "Air Canada".
So, my question is how to disable this translator?
It sound to me like you should use make the property IATA use the type text (add [[Has type::Text]] to the page Property:IATA. Otherwise the wiki will assume the type page, and unless you want to have specific pages about each IATA code, separate from the airline pages, that's not what you want.
And to answer you question: You can set $smwgQEqualitySupport = SMW_EQ_NONE; in LocalSettings.php to disable the functionality you are talking of, but doing so would be quite odd from a user's point of view, as redirects are basically a kind of aliases, and if the alias works in the MediaWiki world, you want it to work in the same way in the Semantic MediaWiki world.

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.

og:title doesn't correpond with the one I set

I have a question regarding the meta property in php.
I have set
and I have a list of products that need to be displayed on the first page. Whwn I click the first product and click the like button the title that appears is different from the one I set, but when I click the other products and then click like I get the correct title. I tried clearing the cache but it didn't work and I tried verifying the link using http://developers.facebook.com/tools/debug and here it teels me that the title is the one I set.
Can anyone tell me what am I doing wrong or what might be the problem? Or maybe you have a soultion for this. :D
Thanks!
Without seeing the page which is being changed and liked, it's hard to know if I am answering your question, but the information may be useful to you anyway.
The issue may be with how many likes have already added up for the page.
Note that og:title and og:type are only editable initially - after
your page receives 50 likes the title becomes fixed
Source: https://developers.facebook.com/docs/opengraphprotocol/
This has happened to me before. The easy fix/workaround I found was this: I had been appending a query string to the page URL for tracking some stats. That URL with the query string had over 50 likes. Once I changed the query string, or left it off, the page had a different amount of likes. So when I used the Facebook linter/debugger, I used the new URL and it picked up my og:title and description change.
Are you able to post a link to the page you are having this issue with?