Adding Title to URL Meteor Iron Router - url

Currently I have
http://www.example.com/videos/videoId
In my iron router,
Router.route('/videos/:_id', { name: 'videoShowtemplate' }
I want to make my site more seo friendly so I was thinking of adding
the video title to the URL.
http://www.example.com/videos/videoId/videoTitle
can you tell me how i can do this? thank you very much in advance.

Go through the docs: https://github.com/EventedMind/iron-router/blob/devel/Guide.md
Keep the same route and just add /:slug to your params.
Do all your validations on _id
Router.route('/videos/:_id/:slug', {
template: 'videoShowtemplate'
}
use the following code to redirect to the site
in html
click here
or in js
Router.go('videoShowtemplate', {_id: id,slug: title});

Related

Durable Id assignment in URL not working in lightning

Problem Statement: To auto-populate the lookup field I use durable Id assignment with name. For e.g. https://sales--dev.my.salesforce.com/m2p/e?CF00N0l0000051XXX=Contract-00000XXX&inline=1
Notice this -> CF00N0l0000051XXX=Contract-00000XXX ~ durableId=recordName In url.
Now, when the user clicks the New button to create a record on the VF page above URL is loaded in classic and populates the Name in lookup like this
Trying to solve: In lightning, URL is getting overridden by this URL
https://sales--dev.lightning.force.com/lightning/o/objectName/new?count=2 Is there a way to achieve the same URL in lightning?
Do you really need it to be an URL hack? Can'y your thing be a quick action? The url prepopulation would be more reliable there and work everywhere.
URL hacking in lightning is bit simpler, you use field API names instead of IDs. These are decent tutorial: https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/, https://sfdcdevelopers.com/2020/02/26/url-trick-in-salesforce-lightning/
So, how do you know where you are, in Classic or LEX. Which URL to use? Have a look at UiThemeDisplayed variable, available in Visualforce and in Apex's UserInfo class.
IF($User.UIThemeDisplayed == 'Theme4d' || $User.UIThemeDisplayed == 'Theme4t' || $User.UIThemeDisplayed == 'Theme4u',
'link for lightning',
'link for classic'
)
Working approach:
Created a controller for VF page:
global PageReference newParty() {
PageReference pageRef;
pageRef = new PageReference('/lightning/o/Party/new?defaultFieldValues=Contract='+contractID);
return pageRef
You can absolutely do this with a button / URL hack in lightning with the Spring '20 release. The URL can use "defaultFieldValues="
https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/

TYPO3 v10.4.9 - Speaking URLs not working

I installed TYPO3 v10.4.9 with boostrap package and created a few custom pages to try things out. I noticed that the "speaking URLs" are not working and I have no idea why. Note that I am a total bigginer in TYPO3, so I'm probably missing something obvious.
Example:
We have a page called Photos. The URL created by "URL Segment" in Page module > "Edit page properties" is https://example.com/photos and the ID of the page is 84.
If I click on the view icon in the Page module, URL https://example.com/photos opens in the frontend and I get a message that says "Not Found - The requested URL was not found on this server".
On the other hand, if I type URL with ID in the browser manually, like so: https://example.com/index.php?id=84, it works perfectly fine. This problem is present for every page I create.
I have created site configuration. Below is the content of config.yaml:
base: 'https://example.com'
baseVariants: { }
errorHandling: { }
languages:
title: 'Example Site'
enabled: true
base: /
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
websiteTitle: ''
navigationTitle: English
hreflang: en-US
direction: ''
flag: us
languageId: '0'
rootPageId: 1
routes: { }
websiteTitle: ''
.htaccess
AddHandler application/x-httpd-php74 .php
##__HCP_END__##
# Anything after the comment above is left alone
Please help. What am I missing here?
If I should paste some more data to help resolve the problem, please let me know. Thank you in advance.
I found a solution. I copied contents of
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess
to .htaccess and now it works perfectly.
Maybe the .htaccess is missing in the root of your installation.

Passing a URL Parameter via a button link

Very simply, I'm looking for a way to grab the value of a URL parameter and pass this to a target URL inside a button.
Ex:
Page URL: https://example-domain.com/page-1?parameter=value1
In this page, there is a button with the link URL: https://example-domain.com/page-2
I'm looking for a way to have this link to be dynamically updated to https://example-domain.com/page-2?parameter=value1
Is there a way that I can handle without a deep understanding of any coding language for my Wordpress website?
Thanks in advance
The solution I found is:
LINK_TEXT_HERE
<script type="text/javascript">
jQuery(function() {
var el = document.getElementById('ELEMENT_ID_HERE');
el.href = el.href + window.location.search;
});
</script>

Laravel 4 Url routing point

I encountered a small problem about the urls in Laravel 4, I created a route with the username variable whose value may contain points(dots). here is the example:
localhost:8888/users/joe.doe
the problem is that it always shows me the error 404
is there a way to activate the point in url?
Route::get('{username}', function() {
return $username;
});
Thanks a lot.
You could have a look at http://laravel.com/docs/routing#route-parameters - and apply a reguler route constraint.

Finding Facebook ID from URL

In Facebook's documentation it says you can find the ID from a URL, and that used to be the case. It doesn't appear to be true anymore.
This example is straight from Facebook's API Documentation:
--------------FACEBOOK DOCS---------------------
The "ids" query parameter also accepts URLs. This is useful for finding IDs of URLs in the Open Graph. For example: https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/
But when you click on that link it gives you:
{
"http://www.imdb.com/title/tt0117500/": {
"id": "http://www.imdb.com/title/tt0117500/",
"shares": 18226,
"comments": 7
}
}
Which does NOT include the real Facebook ID for this example URL. If I go to the debugger and enter this URL I can find the ID, which is: 380728101301
So how can I find the ID without using the Open Graph Debugger? I need to be able to get IDs through the code on my site, and can't manually visit the debugger every time.. anyone know how to do this now?
Thanks very much!
There is one possibility with FQL:
SELECT url,site,id FROM object_url WHERE url = 'http://www.imdb.com/title/tt0117500';
https://developers.facebook.com/docs/reference/fql/

Resources