Apache Wicket: Remove or alter presentation of pageId from statefull pages - wicket

Is it possible to remove the pageId from the URL of a statefull wicket page? It's ok if it's not versioned in the page store because of this.
I've tried overriding the isVersioned()-method to returning false, but I still get the pageId in the URL:
http://localhost:8080/appname/s/frontpage/?11
Or - even better - is it possible to alter the presentation by assigning the pageId to a parameter like this:
http://localhost:8080/appname/s/frontpage/?pageId=11
and thus keep the page statefull?
The reason I would want to do this is because the pageId creates lots of different URLs in my google analytics dashboard which in reality is the same URL:
http://localhost:8080/appname/s/frontpage/?0
http://localhost:8080/appname/s/frontpage/?1
http://localhost:8080/appname/s/frontpage/?2
http://localhost:8080/appname/s/frontpage/?3
etc...
Thank you.

Please check http://mail-archives.apache.org/mod_mbox/wicket-users/201210.mbox/%3CCAAJwaYWaP0Vdn4xmpWSf8Bj-e_m536LAyhn7M9b6sxEcM_RfQQ#mail.gmail.com%3E
And maybe also this: https://stackoverflow.com/a/8667136/497381

Related

Loading paginated data into Grafana

I'm using one of the two datasources:
marcusolsson-json-datasource
yesoreyeram-infinity-datasource
Both can call HTTP API endpoints.
The problem is the endpoint returns paginated response (JSON)..
My panel will be a very simple table that just shows the endpoint's response to the query (HTTP Request).
What I want to achieve is making Grafana grab the paginated data..
Example: When I click on page 1 in table it make a request with page_size=X&page_number=1 and so on.. Is that possible ?
If not possible.. what is the best thing to do here?
Should I use some kind of caching ? What cache suits best with my case and how to implement it?
I've been digging but I didn't really come to something useful.
The workaround I could come up with is by using a dashboard variable..
We create a variable that fills its value from a request to the endpoint and refreshes with the dashboard reload.
We then use that as a dropdown variable starting from 1 to number of pages.. When a page number is selected, it makes a new request to the endpoint to load the data. (By including variable value as a query parameter.)
The thing with this approach is that it doesn't look nice like Grafana's table pagination pane. Instead, the user will have to choose a page number from a dropdown list.

Calendly not pre-filling a form in Webflow

I’m using Calendly in my Webflow project, and it works.
However, I would love to pre-fill the form in Calendly, and there is a guide to do so here: https://help.calendly.com/hc/en-us/articles/226766767-Pre-populate-invitee-information-on-the-scheduling-page
I’ve managed to make the url look like this, using custom code:
mywebsite.com/book-meeting?name=MyFirstname%20MyLastname&email=myemail#test.com
But for some reason Calendly is not pre-filling the form.
Is there anyone else, who has tried this and made it work?
Thanks!
It sounds to me look you would like to pass custom pre-fill values to your embedded Calendly Link.
The best way to do this is to use Calendly’s Advanced Embed Options: https://help.calendly.com/hc/en-us/articles/360020052833-Advanced-embed-options#4
In order to do this you will need to supply your pre-filled values like Name and Email directly to specific Calendly link being embedded. In your example: mywebsite.com/book-meeting?name=MyFirstname%20MyLastname&email=myemail#test.com, it looks like you are passing the pre-fill values to the entire page address rather than specifically to the calendly.com/… scheduling link found in the embedded script.
The best way to do this is as described in help article referenced above. You can add pre fill values script like so:
prefill: {
name:
email:
customAnswers:
}
so that the script to embed Calendly would look something like:
<script>
const params = (new URL(window.location)).searchParams
Calendly.initInlineWidget({
url: 'https://calendly.com/YOUR_LINK/30min',
prefill: {
name: params.get('name'),
email: params.get('email')
}
});
</script>
Where we are taking the parameters from the page url and passing them to Calendly embedded widget. (Note: in this example, I am using an Inline Widget but you can replace this portion of the script with the appropriate API method, ie. Calendly.initBadgeWidget or Calendly.initPopupWidget)
Hope this helps, happy scheduling!

Get the current page url inside a hook for contao

I am using the parseArticle hook for news module for my contao instance. I need to get the current page url inside this parseArticle hook. I had checked with the insert tags "{{env::url}}". But it's not working. It is simply displaying this text. Is there any way to use insert tags inside our hook?
If no, what should be done to get the page url inside that hook for contao?
You can retrieve the current URL via \Environment::get('uri'). This also includes the query string.
In general you can also "use insert tags" this way: \Controller::replaceInsertTags('{{…}}'), but this should never be necessary.
If you want the url to the reader page (without the news item in the URL), you can use
global $objPage
$strRelativeUrl = $objPage->getFrontendUrl();
$strAbsoluteUrl = $objPage->getAbsoluteUrl();
Both of these function can take parameters to add to the URL. See PageModel.php#L1013 for example.
Or use
\Environment::get('url');
Found on https://www.marcosimbuerger.ch/tech-blog/contao-environment-klasse-mit-beispielen.html

Laravel HTML form on multiple pages

How to make a form across multiple pages in Laravel like here
http://www.html-form-guide.com/php-form/php-order-form.html
I have a lot of input fields and i can't find any info on Laravel multiple pages forms. If someone has any good website where to read about it and to see how it is done?
Any help is appreciated.
You can achieve through session of laravel, you can set your values with key and value:
public function step1(Request $request)
{
$request->session()->put('key', 'value');
}
for further information see this link
Other way is make in your client side, with localStorage is cleaner for me, you can use Single Page Aplication and send the data when you're at the final step.
localStorage works seemed to PHP session, check out this link :
you can set the item thought steps, like this:
localStorage.setItem("key", "value");
and retrieve the information like this:
localStorage.getItem("key");
The Single Page application lets you render diferent pages in a route and it's not neccesary to reload the page, you can check out Angular or Ember.js Framework.
If you are looking to do this on server side and not with javascript framework here is what you can approach.
You can make use of Laravel session to store intermediate data between the pages and then pull data out of session to insert into database at the final step.
Detailed Tutorial
https://www.5balloons.info/multi-page-step-form-in-laravel-with-validation/

How can I find an URL of a Facebook page from its ID?

I know a Facebook page ID and I’d like to get a full URL to the page. The full URL looks like this:
http://www.facebook.com/pages/page-title/numeric-id
I don’t know the page-title. If I drop it from the URL and just use the numeric ID, I get a 404. I can call the Graph API to get the full URL from the ID, but that’s too heavy (one extra HTTP request, JSON parsing). Is there a better way?
I'm not fimiliar with Facebook Application but I know a bit about it. If you're talking about the page title, then there is a "name" object in your response code. Get that, and replace the white space with - and place your ID. May be, It will work
'http://www.facebook.com/pages/'.str_replace(' ','-',$name).'/numeric-id
// $name is your page name fetched from object.