CQ link or url component - hyperlink

Is there any cq component that renders a link for external website url
anchor tag with href to an external url
Creating a component where user enter "name", "link", "background-image".
Output a DIV with bacground-image with text on top of it. When user clicks on the text, it should open new window and go to the link (external company site url/ NOT CQ) entered.
Thank you,
Sri

AEM OOB provide several generic components, your usecase is very specific to your project need so feel free to create a new component for same. I feel this is low complex requirement.

Related

Reverse engineering website : cannot find the form inputs in the post request

I need to interact with an external website I don't own. This external website requires credentials that I have. My goal is to add a user but the external website does not offer an external API. It looks like they are using Vaadin.
So to add a new user I need to manually fill in a form. Yet I have been searching for the route the "form" takes to post the input I give but could not find any.
Here is my issue : when I look at the HTML source code in browser I cannot see any form tag. The buttons have all the same id "button". When I fill in the form and look at the network tab in the developer tools, in the "parameters" section I cannot see the inputs I just gave although the POST request does appear. The cookies tab does not show the inputs either.
Consequently my questions are : why can't I find the inputs in the POST request and where can they be ?
Please note : this external website is a medical site so I prefer not share the url and they don't offer a mobile app, so there is no mobile API I could reverse engineer.
Any help appreciated :-)
Not stating the Vaadin version makes that a tad harder give an exact
answer, but at the core both the Vaadin 8 and 10+ behave the same way.
And the short answer to your question is: without another entry-point,
like an API, this can not simply be done using just some POST-Request.
Vaadin is not simply a html-form/request/response-html based framework;
it holds the scenegraph on the serverside in a session. All
communication is done via a single endpoint to the server and state
changes only are communicated back to the client.
For what you are after, your best bet is to use test automation
frameworks like selenium, geb, cypress, ...

Taxonomy list custom, unique link with a field

I've created a list of events with a taxonomy/vocabulary, where the 2 most recent will display on the home page and an events page lists all the events. This works great.
However, I would like to create a link to an external site where a user can get more information on the event. I've set up a field in the taxonomy where we can enter the URL for the event. I would like to have the event name then link to this URL. I am trying to make this so someone who does not know how to code could maintain this site.
I've tried searching for an answer on how to do this. I may not have the correct words in my string to find the right help.
In drupal 7 has facility to add field in taxonomy
1)install link module in drupal 7
2)Created link field in drupal 7 to stored link of external url
3)Used views to list the event name and their external url.

Linking to a non-entrypoint GWT page

Is there a way in GWT to make it so that external sources can link to pages that aren't EntryPoints and have not yet been visited?
The end goal is to allow users to provide URLs to other users that link to a page that is not an EntryPoint. An example is how the GWT history feature works, where after you visit a page (such as http://<ip address>:<port>/MyEntryPointClass.html#NotEntryPointClass), even if you click to a different page and then enter that URL into the address panel, it takes you back to that page. However, if you've never visited that page before, it just takes you back to the entry point page. I have only been able to find solutions where a GWT page links to an external source, and not the other way around which is what I need.
You can use Activities and Places pattern. In your entry point class add:
historyHandler.handleCurrentHistory();
and it will take your user to the default place if no place is specified in the URL, or to the place set in the URL.

How to show Sharepoint Site Usage Statistics in a page?

What's the best way of showing site usage statistics in a page? I know I can view the stats from /_layouts/SpUsageSite.aspx and from designer also, but if I want to show this information in a customized way for a target audience, how can I show this data in a page? at least I need to show "recently visited pages".
You need to use the SharePoint class for return reports. See the SPUsage class on MSDN (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spusage.aspx)
thanks all but I solved my problem quite easily, I simply used
spweb.GetUsageData(SPUsageReportType, SPUsagePeriodType)
didn't know SPWeb has such method, its enough for my requirement.
thank you #Chris SPUsage is also one solution I think, I'll try it next time
From the SP main page, go to the Site Actions, Site Settings, Modify All Site Settings and then select site Usage reports under the Site Administration column.
Once the page loads and shows you the stats. copy the url out of the browser and then ad that to a List or annoucements and then add that to your page as a web part with a hyper link to the stats report.
you could also create a new web-page and then insert an I-frame object with the stats report url and then link the new page to the parent site using a List.

hide hyperlink text of anchor <a> tag in browser status bar but it should navigate

I have a referral project.
In that there is an agent between the
affiliate(my site) and the target site.
So all hyperlinks displayed in my
site will be redirected to the agents
site and then it is redirected to the
target site.
The hyperlink itself is the link to
the agents site.
So i am displaying all products. I
have given links to them. When users
hover a hyeprlink you can see the
href text displayed in the status bar
which will be the agents site.
The requirement is the hyperlinks of
an agent site should not be displayed
in the status bar.
My solutions and assumptions
So i can use span onclick =
window.location = hrefOfAgentLink.
I have seen in other sites that they
redirect to another scripting page
and then the redirection takes
place. for example
http://sitename.com/click/id=32.
The id refers to the hyperlink in
database. hope they fetch the link
and they do a location header to
redirect to the agent page.
Why so? because the user should not see where the link goes.
I want to know whether there is(are) any other option(s) so that the hyperlink will not be visible in the status bar and in the address bar when it is redirecting.
Anyway when redirecting the agents url is not visible because it immediately redirects to the target site.
I would like to have the stackoverflow users suggestions. Thank you.
You used to be able to set the status bar message using javascript, but you can not do that reliably anymore. This is most probably because the browser wants to protect the user. Instead of trying to hide the URL, perhaps you should work on a "redirect-URL" that looks reliable and that makes it obvious to the user both that it is a redirect-URL and where it is going. For example this kind of URL would both make me aware of where I am going and that my access is going to be recorded:
tracker.my-ad-network.com/stacktrace.com/ad/568
Instead of something like this (that would not make me feel safe):
dashj2.gggfbad.com/index.php?aid=1232808432&ref=123432.
And as noted above, start accepting serious attempt to help you or people will simply stop :)
Piotr
You can use the new data attribute so your code would look something like this:
link text
Then in your JS, if you're using jQuery for example:
$('a').click(function(e){
e.preventDefault();
var loc = $(this).data('redir');
window.location = loc;
}
Not too hacky for what you're trying to accomplish.

Resources