Drupal 8 make a link with dynamic url paraneter without coding - hyperlink

I created two separate content types: "Clients" and "Injuries".
In "Clients" each record/node has a client_id (autoincrement by module Serial). In "Injuries" there is a field client which refers to client_id.
I created a (block) View for Injuries, with a contextual filter "Content: Client" so that I can filter out all the injuries of a specific client (for example: client_id = 3), just by typing the URI: /injuries/3.
Now I'm trying to create a link on the Client's page, which dynamically uses the client_id of that client. I tried the module "Linkit" and "D8 Editor Advanced Link".
Is there a way to get the client_id value of the node and use it in the URI?
I also try to make the link in a table view. Unlike the "edit-link" and the "view-link" which are in core, there's no way to customize the path in there.
Can anyone help pointing me in the right direction? Can I make it with the UI of Drupal 8 or do I have to dive into code?

You can create a token based field for your client content type using field_token_value module.
You create this field as usual and in the settings field value should be something like this
see all injuries
where [node:field_client_id] would be replaced with the appropriate client_id each time.
NOTE: There is also a link on the settings page that you can also display all available tokens

Related

Build URL Using GA Attributes

Good Day All
I am completely new to this type of query but is it possible to define a url on a button click on a page that populates the/a URL with information form the Google Tag stack? e.g. Campaign, Source etc?
Sorry for the vague question.
Here are the two method that you can use to create a GA Attributes tagged url
https://support.google.com/analytics/answer/1033867?hl=en
&
http://www.utm.io/

Auto Search functionality for Schools/Universities using Asp.Net MVC

I am building a website where the user should have the capability of adding their School/University. I have noticed in LinkedIn, when i tried to type in my school name , it showed up a auto search box with all the schools, beginning with the letter i typed. How can i achieve the same functionality?
Do they save all the Universities in their database ? Or is there any Open webservices i can use that will show all the Schools/Universities ?
Thanks !
This feature is called "Auto Complete" and the text boxes are enabled with that. These allow you to filter the data required according to the characters you type in.
Please see this post for auto-complete feature implemented using jQuery.
Razor: Auto-complete text box inside jqGrid, How to bind values?
The example shown in that page lists all from the database. However, as a next phase, you can as well extend this feature to look for a WCF exposed service for universe of schools/colleges.
FYI" "GetSkillNameAutocomplete" is a method in the controller that takes a string parameter as an input (the search string) and gets the value(s).
Hope this helps!

How to dynamically generate url for image map in Oracle ApEx?

The scenario:
I have an ApEx page which pulls a record from a table. The record contains an id, the name of the chart (actually a filename) and the code for an image map as an NVARCHAR2 column called image_map.
When I render the page I have an embedded HTML region which pulls the image in using the #WORKSPACE_IMAGES#&P19_IMAGE. substitution as the src for the image.
Each chart has hot spots (defined in the image_map html markup) which point to other charts on the same ApEx page. I need to embed the:
Application ID (like &APP_ID.)
Session (like &APP_SESSION.)
My problem:
When I try to load the &APP_ID as part of the source into the database it pre-parses it and plugs in the value for the ApEx development app (e.g. 4500) instead of the actual target application (118).
Any help would be greatly appreciated.
Not a lot of feedback - guess I'm doing something atypical?
In case someone else is trying to do this, the workaround I ended up using was to have a javascript run and replace some custom replacement flags in the urls. The script is embedded in the template of the page and assigns the APEX magic fields to local variables, e.g.:
var my_app_id = '&APP_ID';
Not pretty, but it works...
Ok - I think I've left this open long enough... In the event that anyone else is trying to (mis)use apex in a similar way, it seems like the "apex way" is to use dynamic actions (which seem stable from 4.1.x) and then you can do your dynamic replace from there rather than embedding js in the page(s) themselves.
This seems to be the most maintainable, so I'll mark this as the answer - but if someone else has a better idea, I'm open to education!
I found it difficult to set a dynamic URL on a link to another page - directly - attempting to include the full URL as an individual link target doesn't work, at least in my simplistic world, I'm not an expert (as AJ said: any wisdom appreciated).
Instead, I set individual components of the url via the link, and a 'Before Header' PL/SQL process on the targeted page to combine the elements into a full url and assign it to the full url page-item:
APEX_UTIL.set_session_state(
'PG_FULL_URL',
'http...'||
v('PG_URL_COMPONENT1')||
v('PG_URL_COMPONENT2')||
'..etc..'
);
...where PG_FULL_URL is an item of Type 'Display Image', 'Based On' 'Image URL stored in Page Item Value'.
This is Apex 5.1 btw, I don't know if some of these options are new in this release.

Linkedin url function

I came across a post on Quora addressing why LinkedIn uses tokens like *1_*1_*1_*1_*1_* in their url. The answer mentioned these help track where a user came from to enable a user to return to where he came from.
How exactly does the URL store that type of information, and why would they use that token instead of something more conventional, such as ?last=this-page?
Appears that those are used to carry forward and populate the form values on the left for the search page. The 1 is probably a section or form number, * means wildcard (empty on form). The _ is just a separator. Try populating a previously empty form field and click search You'll you see one of the previously *1 portions of the url be replace with the value you provided in your form.

SSRS 2008 change built-in User ID

is there a way to change the value of the built-in parameter: User ID? I don't need the name of the windows authenticated user, but the name that I pass in the url to open the web page containing the report.
i.e. http://servername/ReportList/Pages/Report.aspx?username=somename
I would like that User ID = username, so I can display it in the footer of the page.
Thank you
C.
You can't change the value of the built-in field but you can create a parameter, even calling it UserId or Username. (The built-in field is not really a parameter.)
Then you can assign a value to that parameter using URL Access:
https://msdn.microsoft.com/en-us/library/ms155391.aspx (SQL 2016 link)
For example, to specify two parameters, “ReportMonth” and
“ReportYear”, defined in a report, use the following URL for a native
mode report server:
http://myrshost/ReportServer?/AdventureWorks2008R2/Employee_Sales_Summary_2008R2&ReportMonth=3&ReportYear=2008
For
example, to specify the same two parameters defined in a report, use
the following URL for a SharePoint integrated mode report server. Note
the /_vti_bin:
http://myspsite/subsite/_vti_bin/reportserver?http://myspsite/subsite/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2.rdl&ReportMonth=3&ReportYear=2008
Note that you can't use URL access when running the report through the "Report Manager" interface which gives the title bar and the views to explore reports (usually at /reports/.) ReportServer is a different service that just sends the report itself.

Resources