I am not a developer but I need help talking to my web developer. We have a company website with staff profiles made with TYPO3. On each profile site, we want to embed an URL to a repository website, which will show a list of the person's publications. The URL encodes a SOLR search string for this repository. So, the URL is the same for all staff profiles except for a personal identifier somewhere in the middle. Instead of typing the complete URL into every staff profile page, I would prefer to have a URL constructed with placeholders like this
placeholderA+staffID+placeholderB
In case the SOLR search string changes in the future (i.e. excluding certain document types in this search or changing the sorting) we would have to change only the placeholders, not the complete URL in each and every profile page. There has to be a simple way to do this, but my web developer tells me this would require a database with the staff IDs and a lot of scripting. Is she right? Since we have to touch every profile page to include the URL initially, it would be ok to enter and store the unique staff identifier on each profile page. I just want to avoid touching each page again when changes are required.
It is such a useful concept, there has to be a plugin or something to do this already. Can you throw me some keywords or hints for our next discussion?
How is your URl build?
in general URLs are build in multiple parts
[[[<protocol>]<domain>]<path>[?<parameters>]][#<anchor>]
Now we need to identify where you want to insert the staffID:
is it in <path> or in <parameter>?
In TYPO3 we don't have a real <path>. It's just an image to hide the basic URL index.php with some parameters. first of all the parameter &id=123.
further parameter can occur as parameter or as path segments. Anyway TYPO3 will handle a translation between virtual path and parameters (either an extension like realurl or the core). For URL generation you call TYPO3 providing a list of parameters, or if a 'page' is called you will end with a list of parameters which will decide the rendering.
Then you can mixup the URL generation:
You take a generated URL and add path segments as you 'guess' them, without involving TYPO3. This might result in problems as you will call the server with an url TYPO3 does not know about as it has not generated it. If TYPO3 generates an URL it stores it in the database with the 'translation' into parameters.
realurl can guess the translation, but sometimes it failes, especially if chashes are used.
What are cHashes?
with cHashes TYPO3 secures the page cache against unrelated parameters. If a page is generated it depends on the parameters. Any further parameter might result in another page, so TYPO3 stores a hash of the parameters with each cached page. For verification this hash can be added to the URL. this additional parameter also is stored in the 'translation' table.
If you now add parameters to an URL which is stored and it gets translated back to parameters you have an cHash parameter which identifies the cached page. But only for a part of the parameters. your added parameters were not known and not considered when the page was generated and stored in cache. If the cached page is delivered your additional parameters are 'lost'.
So it is necessary to include all parameters in URL generation with TYPO3.
Your adding of the staffID must be done with TYPO3 and can't be an concatenation of path segments in the HTML templates (or javascript).
If you later on change your parameters you need to change the generation of your URLs.
I would recommend to add the staffID as a field to the record and generate the URL to the document list with TYPO3.
Related
I have a typo3 Plugin (my own) which have lots of sub pages.
Now all Pages got their own canonical URL ... but I want that they only have the canonical from the page which contains the Plugin.
Is that possible?
Thanks in advance.
As far as the content changes with the parameters these parameters belong to the canonical URL.
You might not want your parameter specified pages indexed, but that needs other metatags than a non unique canonical url.
A canonical URL is used to have a unique URL for a page which can be accessed with multiple URLs. So Search engines know which URL to use and don't think of duplicate content.
If you really want to fool search engines with multiple content for the same URL you can of cause generate the base URL without all parameters and use it as canonical URL. Mind the value of config.linkVars. Just build your meta tag by hand using page.headerData.
What's the best practice to be able to store fluid form variables as a bookmark (for simple search filter storing)?
We have a simple extbase&fluid plugin that shows searchfilters and searchresults. The filters are a collection of input and select fields, all created with . Fluid puts in a lot of extra parameters with _referred information and chash's into the request.
Now we want a visitor to be able to bookmark a search result easily. If we use a HTTP GET request, the URL sadly exceeds the URL variable limit because of all the extra parameters; and without them, the fluid plugin won't take on the arguments (unless we disable caching of the whole page?).
The best way (imo) is to generate a clean url that can be stored. In Fluid you can add a link with only the parameters you need and add an onclick event with JS to add this link as a bookmark.
<f:link.action action="yourAction" controller="yourController" arguments="{filterArguments}">Add Bookmark</f:link.action>
How to add the bookmark function with js(jQuery):
How do I add an "Add to Favorites" button or link on my website?
It is also a good practice to configure realurl to produce nice urls for your extension
it is possible to have a direct path to a special news entry?
example:
my link is: http://www.domain.de/start/topnewsdetail/news/really-long-name-of-news-entry.html
and it would be nice to have
http://www.domain.de/newsEntry.html.
Can someone give a hint?
it is a little bit complicated if you want a general automatic solution.
you can do it by hand if you insert pages of type 'external url' where you insert the long path as external url.
with realurl you have problems as realurl at least will use one path segment for the page with the detail view before the last segment which is for identifying the news record. AFAIK coolurl can ommit the path segemnt for the page.
on the other hand: make sure the news identification (title, subtitle?) is unique and does not collide with pathes for normal pages.
at last you can use .htaccess rewrites, but that needs to differentiate between short urls for news and short urls for top-level pages. So those urls will show the page, those urls are not generated inside of TYPO3 and so nowhere used (except manual)
this EXT. adds a custom link to records like system category or news:
https://typo3.org/extensions/repository/view/recordlink
It'S deployed for TYPO3 6.2 but perhabs it'S helpful to create an own EXT.?
As per the GWT docs, there are two ways two internationalize my GWT app. One is, declare the language in the HTML itself (hardcoding) through meta tags, another is to use a query param in the URL (like &locale=de).
My webapp is dynamic,different users from different locales will be using it, so the first option is not viable. The 2nd option is fine, but somehow, appending query params to a URL is my pet peeve. I tried to make it dynamic by doing something like $("head).append("<meta name='gwt:property' content='locale=de'>"); first thing on onModuleLoad, it doesn't work.
My app will actually be a redirection, some other web-page will contain a redirection like foo.com&locale=de. Based on that, it will load the required locale fine. But after that, I want to reload it again without showing the query param in the URL, taking the locale information from cookies which can be set in the first load. Is it possible to do so?
There is a third option using cookie.
Reference - GWT Internationalization for dynamically generated content
Ensure you set locale value to the cookie or have a default value for your cookie before user chooses his locale. In our case user chooses a language before login ( where i set the cookie locale value for the user) and read this into the gwt application on load.
Adding the parameter to a model (in a Controller) and picking it up on the client (in a *.jsp) will work for you?
<meta name="gwt:property" content="locale=${locale}">
Then you just need to refresh the page and reset the locale value in a controller. Add the meta-tag code in your html/jsp page, it should be there prior to page loading.
onModuleLoad works with code already loaded to the browser window, so appending meta after loading will not work.
I am currently working with a client to redevelop their website. One of the final things I need to do before launch, is to make sure that their old website's pages are correctly redirected to the new URL structure of the new website.
Unfortunately, when I check Google to see how their current site is indexed, this relatively small website appears to have over 1500 pages indexed.
When I look at the indexed links on Google, many appear to be duplicates of the same page, but because of the terrible URI structure used on the old website, Google treats them differently.
For example, the 'Map' page is indexed at least twice on Google, under the following 2 URLs:
www.website.com/frame_page-map.html?mp_session=iris7k85851j05q55piqci31u3&mp_session=iris7k85851j05q55piqci31u3?page_code=map&mp_session=iris7k85851j05q55piqci31u3&mp_session=iris7k85851j05q55piqci31u3
www.website.com/frame_page-map.html?mp_session=sel6m8j5cu8lulep4dqa32sne7&mp_session=sel6m8j5cu8lulep4dqa32sne7?page_code=map&mp_session=sel6m8j5cu8lulep4dqa32sne7&mp_session=sel6m8j5cu8lulep4dqa32sne7
Only the session name is different in the URL (and I have no idea why it is repeated four times in a single URL, either).
For reference, the replacement URL for this page is:
www.website.com/contact/map
My question is: How do I setup a redirect for these multiple records on Google? Do I simply set-up the redirect for the old URL minus all of the URI parameters (i.e. www.website.com/frame_page-map.html) or is there another better method to do this?
Thanks for any help you might be able to offer!
It depends on what your goals are. If you don't care about the querystrings then setup a 301 (permanent redirect) that points to just your root page - map.html. To prevent google from indexing querystring params as separate pages use the canonical tag and have it reference the parent. This isn't guaranteed to work, but google takes your canonical into consideration when indexing.
If you care about the querystring values then you will have to setup a redirect for each one. There is a querystring parameter that you can append to your redirects that will tell it to be ignored so you don't have to write a regex that detects it.