HTML <meta> tags in Wt?
Added by Osman Zakir almost 8 years ago
I was just wondering if someone could help me out here. I want to know how create an HTML
tag in Wt. Like, for example, if I want to add a viewport tag (e.g.
). Is there a function that can do this? Thanks in advance?
Replies (8)
RE: HTML <meta> tags in Wt? - Added by Roel Standaert almost 8 years ago
Hi,
There are a few ways. In wt_config.xml
, there's an option meta-headers
. You can add any meta tags there.
You could also set meta tags with WApplication::addMetaHeader().
For Wt 4, we've also added an option head-matter
that allows you to add arbitrary tags to the <head>
, like <meta>
and <link>
tags.
Regards,
Roel
RE: HTML <meta> tags in Wt? - Added by Osman Zakir almost 8 years ago
Thanks.
This is what I wrote there for now (including what was already there by default):
<meta-headers user-agent=".*MSIE.*">
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0" />
<meta name="author" content="Osman Zakir" />
<meta name="keywords" content="currency convertor, currency, converter" />
<meta charset="utf-8" />
</meta-headers>
Is this fine?
RE: HTML <meta> tags in Wt? - Added by Osman Zakir almost 8 years ago
Also, I was just wondering - I've set the "reverse-proxy" setting to "true" instead of "false". It's because I want to also try to deploy it behind a reverse-proxy if I can find out how. I can do it with the built in HTTP connector, right?
RE: HTML <meta> tags in Wt? - Added by Osman Zakir almost 8 years ago
What comment of mine is that referring to, exactly? Could I trouble to clarify, please?
Also, one more thing: how exactly should I take specific information from the web for my app? Like, for example, when I want to lookup currency conversion rates in real time for the app's functionality.
RE: HTML <meta> tags in Wt? - Added by Wim Dumon almost 8 years ago
It was referring to the fact that setting meta headers works with the built in http connector.
If you want to retrieve information from the web, you can use Wt's Http Client functionality, e.g. to access webservices.
Wim.
RE: HTML <meta> tags in Wt? - Added by Osman Zakir almost 8 years ago
Oh, sorry, I was asking about deploying behind a reverse-proxy using the built-in HTTP connector. My bad if was unclear.
As for the Wt Http Client, I'd like some help and tips and understanding how to use it. Though I also asked Koen in another thread I'd made about this (I was thinking I should make a separate thread about getting information from the web, so I made a separate thread, and Koen replied to it. So I asked him about this).
RE: HTML <meta> tags in Wt? - Added by Osman Zakir almost 8 years ago
The place I have in mind is https://www.google.com/search?q=currency+conversion+rates&ie=&oe. If, for example, I want to use the function Wt::Http::Client::request() to make a GET request to that page with my query, what would be the best way to do it? How do I use that function, exactly?