I'm using path auto module to automatically stores images in the projects subfolder. I'm using the [title] token and I had a unpleasent surprise: the title "abc / dce", creates 2 folders.
I was not expecting this because in the pattern descrition, [title] is clearly distinguished by [title-raw].
[title] Node title
[title-raw] Unfiltered node title. WARNING - raw user input.
So, how can I fix this issue, I would like to use the title I have in the url "abc-dce"
thanks
These tokens aren't defined by Pathauto, but by the Token module. If you want a token that will give you a stripped down version of the node title, you can create it using the hooks provided by Token. The answer to this question may also help.
You can also work with the punctuation settings of the pathauto module to deal with the / character before it causes problems.
Related
I'm trying to migrate my ASPX site to Kentico, and as part of my task I'm migrating URLs. I need to preserve my URL structure, so I need to keep URLs which look like : "foo.com/bar.aspx?pageid=1".
I checked page's "URLs" property tried to use wildcards, some patterns like /bar/{pageid}- /bar/{?pageid?}-, etc but Kentico always replaces question marks.
Is there a way to achieve that via the admin interface?
You don't need to do anything in order to use "foo.com/bar.aspx?pageid=1" url.
Create a page under the root and call it bar, so you'll get a page # foo.com/bar.aspx. Kentico and/or .net does not care what you add to a url after question mark, so foo.com/bar.aspx?pageid=1 will work as well as foo.com/bar.aspx?someparam=sdf, or foo.com/bar.aspx?id=1&p=3&t=3.
You may (or may not) implement some functionality based on query string (e.g. paging), so it will parse query string and act in appropriate way.
By default Kentico UI does not handle adding URL aliases with URL parameters like you show. There is an article on the DevNet for a URL Redirection module which has code you can import into your site to allow you to perform these redirects within the Kentico UI. I'd suggest using this approach.
Unfortunately, I can't share a code sample since it's an article but it also has a link to download the code too. This appears to only be coded for Kentico 8.2 right now but I'm guessing you could do some work to make it work for other versions if you needed.
I think there are few concepts that you are clubbing here. I will start with your line code here
/bar/{pageid} - {pageid} is a positional parameter in Kentico's language if you choose to use dynamic URLS based on patterns. SO if you have a code that relies on pageid parameter to fetch some data then Kentico will pass that value. E.g in case of /bar/420, it will pass pageid as 420 different web parts on your template
/bar/{?pageid?} - This will search for query string parameter "pageid" on the request URL and replace its value here. So if you passed foo.com/bar.aspx?pageid=366, the resulting URL will be /bar/366
The #1 is positional parameter and #2 is the way in which Kentico resolves query string macros.
I hope this clarifies.
I wrote an RSS2 feed on WordPress a while back, but for some reason, some of the URLs aren't working anymore. The current version of WP is 4.7.2.
For example, https://justhoodsbyawdis.com/product/jh001/feed/ works, but https://justhoodsbyawdis.com/brands/feed/ does not.
Note that https://justhoodsbyawdis.com/product/jh001/ is a valid page on the site, but that https://justhoodsbyawdis.com/brands/ is not, because it is only valid for feeds. The latter results in an "ERROR: This is not a valid feed." message.
Is there a way to make an URL for a RSS2 feed, even without an associated WP page (i.e. without the "/feed/" at the end).
Thanks!
Rob
EDIT 1:
I added a post called "brands", which fixed the problem. The only thing is that the dummy post is viewable by anyone. Any ideas how to block it, but not the feed?
Another problem is that query strings break the feed, for instance:
https://justhoodsbyawdis.com/products/feed/?name=hoodies
doesn't work, although it does without the "?name=hoodies".
How would I make that work?
EDIT 2:
It would appear that the name query string parameter is now causing problems - see:
https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
Is there a way to make it backwards compatible? Otherwise, the existing app that calls the feed will also have to be changed...
I wound up creating dummy pages to fix the invalid feed error.
I had to change the "name" query string parameter to "prod_name" so as to not conflict with reserved terms.
Rob
I need to get the value of a field that is on the "Parent page" of one of my content panes. I would like to do this through the use of tokens, and the only seemingly useful one that I can find is current-page:query:? I am assuming that I need to replace the '?' with something in order to get the field from the "Parent node".
How do I use this token, or is there another way to accomplish this.
If you have a URL like
http://dev.druedu.com/node/add/answer?field_answer=161
and want the value of the field_answer token, do this
current-page:query:field_answer
That's right, here another option if you are using "Clean URL" in your Drupal Metadata & Search option in your Drupal Configurations:
Args Format: For urls formatted like http://server/node/120/key use
[current-page:url:unaliased:args:value:2] to return key.
More info: https://www.drupal.org/node/296453
Remember always you need install Token Module
If you are using Webform 3.x you need to install a patch also; with webform 4.x everything is Ok.
I figgured it out, I can just use the contexts in panels!
I’ve a bit of annoying problem with a Drupal site. I’ve a “recommend to a friend” field where one can send an article link to an E-mail address. The problem is, that it uses the variable !name in the mail and when I’m receive a mail, it uses the name before the “#” in my mail.
I use my mail as username, so if I’ve registered a user with the username: johndoe#google.com it will present the !name variable as johndoe.
What I want is to display the first name (and maybe the last name) so it says: John Doe recommends this article …
But how can I do that? I’ve search like crazy for the setting.
Thanks
Sincere
- Mestika
To replace user names in quotes by reals names it's necessary to replace Phorum´s standard function for quoting. Since it only makes sense to have one module modifying the quoted text, you can disable this one part of this module. Use System Sanity Checks to control if there is only one module using the quote hook. The default value is "disabled".
TUV Rheinland of North America
You could also try the Custom Tokens module. I use it to get text from my user's Content Profile.
How special characters in username converted to user path (users/username). i'm asking because when i use "." in user name its removed in user path.
for ex: stefan.z path will be users/stefanz
By default, Drupal don't do this, it uses the user's id instead.
Most likely you are using path auto to do this, which can hook into the translitation module. It also has some of it's own functions, that is uses to clean up the url generated.
Special characters are not allowed like that generally- but if you use the Pathauto module, you can change the vanity URL of user paths and also tell Pathauto what characters are allowed and what isn't.