How to rename thewire's URL in Elgg? - apache

I have an install of ELGG, and I set up thewire. I hate the name thewire so I modified the language file, so it would look like posts.
When I looked at the URL on the posts page, it still said http://localhost/thewire, not http://localhost/posts. How would I make .htaccess change the URL to the desired effect.
I tried mod_rewrite, but I don't know what to do with it.

You need to do two things:
Change the URLs produced for thewire posts (register your own handler):
elgg_register_entity_url_handler('object', 'thewire', 'CUSTOM_HANDLER');
Handle new URL format instead of original one:
You may use 'route' plugin hook or try to use already existing plugin for that: http://community.elgg.org/plugins/854839/1.1/pagehandler-hijack-18x

Related

Customizing Route in Vue

I'm using Vue and I currently have a page setup that is in the folder structure:
/pages/tg/_tg_id.vue
The setup is working fine as going to website.com/tg/<user-id> resolves to the user's page based off ID.
I'm now being asked to include a username in the URL, but I still need the id as names change and some user's don't even have a name. As a solution I'd like the new URL structure to be:
website.com/tg/<user-id>/<any string>
So that we can use a link that has the username in it, purely for vanity purposes (putting any string after the last slash should resolve in the exact same way).
I'm unsure of how to set something like this up, currently my nuxt.config.js file has no routing settings. Is there something I can add to settings to get the desired behavior?
If you need only second option with username you can just rename your page to
/pages/tg/_tg_id/_username.vue
and thats it.
If you still need your first url too you can use https://github.com/nuxt-community/router-extras-module and define alias inside your page or by extending routes by hand.

Display an internal link URL on a page/article with Pelican

The usual syntax to make links with Pelican is:
This is [a link]({filename}/foo.md)
That works just fine.
But I'm on a page where I'd like to actually show the URL of the link. That is, I want the generated HTML to be like this:
<p>Here is the link:</p>
https://example.com/foo.html
I tried writing the obvious:
[{filename}/foo.md]({filename}/foo.md)
But that got rendered as:
{filename}/foo.md
I couldn't find anything in the documentation, is there any way to do that?
I don't think the feature in question was designed to behave that way. If it were me, I would use:
[https://example.com/foo.html]({filename}/foo.md)

Yii how to redirect to particular URL

I have used url beautifier to remove index.php?r= from URL. it works fine.
now i want user to redirect to URL if user hits particular url.
suppose
http://localhost/xm/xmds.php?wsdl
To
http://localhost/xm_demo_menu/WebService/service
how to achieve this. i search lot on google but not found material relevant to my problem
any suggestions ?
I do not see where the problem should be. See documentation
In you controller, simply call:
$this->redirect("http://localhost/xm_demo_menu/WebService/service");

Friendly url with floating count of form parameters

I have form with checkboxes. Afrer submit url looks like:
www.site.com?mod[]=1&mod[]=2&mod[]=3
How to rewrite url above (apache mod_rewrite) into:
www.site.com/mod:1,2,3
Big problem is that i don't know how many checkboxes will checked
Using just mod_rewrite, I cannot see a way to do this, however, using RewriteMap, you could link to an an external script that would take the query string and return the appropriate new url segments. Then invoke the defined map (program) in your RewriteRule.

How to create MSDN like links in Sandcastle documentation website?

I've generated a website documentation of my project with Sandcastle. This website uses frames so when I click though sites my URL in browser does not change.
I would like to have URL changed in browser when I browse through website documentation generated with Sandcastle. Why? Because I would like to link to concrete subpages of documentation from other parts of my developer environment.
And further more I would like to have this links permanent. So when I generate once again documentation from new version of my project, links will not change so that I will not need to change all links to new.
Is this possible and how to acomplish this?
If you add the code below to the top of SplitScreen.js the browser will "inject" the TOC frame and focus on the content you linked directly to (using the trick Vitaly Shibaev showed).
if (window==top) {
window.location = "/?topic=" + (window.location.pathname.substring(1));
}
This code works it the documentation is placed at the root of your website - if you have it in a sub-folder you need to expand on "/?topic" and remove the sub-folder part from the pathname part.
With this change you can use the "direct links". I also expect people who find you via Google get a better experience (getting the content they searched for AND the TOC bar).
In order to create correct links to specific subpages of documentation you may use similar request: $DOCUMENTATION_ROOT$/Index.aspx?topic=html/$TOPIC_ID$.htm
E.g. http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
instead of http://www.ewoodruff.us/shfbdocs/html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
Vitaliy and mawtex have solved the 'how to link to documentation subpages' part of your question.
The "making links permanent so they do not change when regenerating documentation" part of your questions is solved automatically, since the html file names created are based on a hash of the topic name by default. I.e. If you do not change the part of your code that you are documenting, then it will use the same file name.
You can change the way that html file names are generated, but all given methods are based on the member name or a hash of the topic ID, so links shouldn't break if the code hasn't changed.
See Sandcastle Help File Builder's NamingMethod documentation for more info.