Thread: Re: [Cppcms-users] How to link external URL with CppCMS?
Brought to you by:
artyom-beilis
From: hoang n. <ngu...@ya...> - 2018-09-20 15:24:36
|
Nazim, I tried the following code as you said and it failed: response().out() << <a href="https://www.google.com">Google</a>; What am I missing? -------------------------------------------- On Thu, 9/20/18, Nazim Can Bedir <naz...@ne...> wrote: Subject: Re: [Cppcms-users] How to link external URL with CppCMS? To: "cpp...@li..." <cpp...@li...> Date: Thursday, September 20, 2018, 5:07 PM Hello, 'url' template command is used to output address of url_mapper routes. If you want to create link for an external URL, you just need to use usual HTML; i.e. <a href="https://www.google.com">Google</a> Regards,Nazim Can. -- С уважением, Назым-Джан Бэдир 12:45, 20 September 2018, Asog <ret...@gm...>: Hello, I got my CppCMS page working following this tutorial (full code). However, it doesn't show how to link to an outside URL (i.e., www.google.com). Can someone point out to me how it can be done? TIA. _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users -----Inline Attachment Follows----- -----Inline Attachment Follows----- |
From: Nazim C. B. <naz...@ne...> - 2018-09-20 15:59:28
|
Hi,<div><br /></div><div>You forgot that you are writing code in C++, so you need to start and end string literal with " (double quote), and escape the inner quotes.</div><div><br /></div><div>response().out() << "<a href=\"https://www.google.com\">Google</a>";</div><div><br /></div><div>Regards,</div><div>Nazim Can.<br /><br />-- <br />С уважением,<br />Назым-Джан Бэдир<br /><br />18:24, 20 September 2018, "hoang nguyen via Cppcms-users" <cpp...@li...>:<br /><blockquote><p>Nazim,<br />I tried the following code as you said and it failed:<br /><br />response().out() << <a href="<a href="https://www.google.com">https://www.google.com</a>">Google</a>;<br /><br />What am I missing?<br />--------------------------------------------<br />On Thu, 9/20/18, Nazim Can Bedir <<a href="mailto:naz...@ne...">naz...@ne...</a>> wrote:<br /><br /> Subject: Re: [Cppcms-users] How to link external URL with CppCMS?<br /> To: "<a href="mailto:cpp...@li...">cpp...@li...</a>" <<a href="mailto:cpp...@li...">cpp...@li...</a>><br /> Date: Thursday, September 20, 2018, 5:07 PM<br /><br /> Hello,<br /> 'url' template command is<br /> used to output address of url_mapper routes. If you want to<br /> create link for an external URL, you just need to use usual<br /> HTML; i.e.<br /> <a<br /> href="<a href="https://www.google.com">https://www.google.com</a>">Google</a><br /> Regards,Nazim Can.<br /><br /> -- <br /> С<br /> уважением,<br /> Назым-Джан<br /> Бэдир<br /><br /> 12:45, 20<br /> September 2018, Asog<br /> <<a href="mailto:ret...@gm...">ret...@gm...</a>>:<br /><br /><br /> Hello,<br /> I got my CppCMS page<br /> working following this<br /> tutorial<br /> (full<br /> code). However, it<br /> doesn't show how to link to an outside URL (i.e.,<br /> <a href="http://www.google.com">www.google.com</a>).<br /> Can someone point out to me how it can be done? TIA.<br /><br /><br /><br /> _______________________________________________<br /> Cppcms-users mailing list<br /> <a href="mailto:Cpp...@li...">Cpp...@li...</a><br /> <a href="https://lists.sourceforge.net/lists/listinfo/cppcms-users">https://lists.sourceforge.net/lists/listinfo/cppcms-users</a><br /><br /><br /> _______________________________________________<br /> Cppcms-users mailing list<br /> <a href="mailto:Cpp...@li...">Cpp...@li...</a><br /> <a href="https://lists.sourceforge.net/lists/listinfo/cppcms-users">https://lists.sourceforge.net/lists/listinfo/cppcms-users</a><br /><br /> -----Inline Attachment Follows-----<br /><br /><br /> -----Inline Attachment Follows-----<br /><br /><br /><br /><br />_______________________________________________<br />Cppcms-users mailing list<br /><a href="mailto:Cpp...@li...">Cpp...@li...</a><br /><a href="https://lists.sourceforge.net/lists/listinfo/cppcms-users">https://lists.sourceforge.net/lists/listinfo/cppcms-users</a><br /></p></blockquote></div> |
From: Asog <ret...@gm...> - 2018-09-20 16:06:59
|
This works too, but not sure about neatness: response().out() << "<a href='" << "https://www.google.com" << "'>Google</a><br>"; On Thu, Sep 20, 2018 at 10:59 PM Nazim Can Bedir <naz...@ne...> wrote: > Hi, > > You forgot that you are writing code in C++, so you need to start and end > string literal with " (double quote), and escape the inner quotes. > > response().out() << "<a href=\"https://www.google.com\">Google</a>"; > > Regards, > Nazim Can. > > -- > С уважением, > Назым-Джан Бэдир > > 18:24, 20 September 2018, "hoang nguyen via Cppcms-users" < > cpp...@li...>: > > Nazim, > I tried the following code as you said and it failed: > > response().out() << <a href="https://www.google.com">Google</a>; > > What am I missing? > -------------------------------------------- > On Thu, 9/20/18, Nazim Can Bedir <naz...@ne...> wrote: > > Subject: Re: [Cppcms-users] How to link external URL with CppCMS? > To: "cpp...@li..." < > cpp...@li...> > Date: Thursday, September 20, 2018, 5:07 PM > > Hello, > 'url' template command is > used to output address of url_mapper routes. If you want to > create link for an external URL, you just need to use usual > HTML; i.e. > <a > href="https://www.google.com">Google</a> > Regards,Nazim Can. > > -- > С > уважением, > Назым-Джан > Бэдир > > 12:45, 20 > September 2018, Asog > <ret...@gm...>: > > > Hello, > I got my CppCMS page > working following this > tutorial > (full > code). However, it > doesn't show how to link to an outside URL (i.e., > www.google.com). > Can someone point out to me how it can be done? TIA. > > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -----Inline Attachment Follows----- > > > -----Inline Attachment Follows----- > > > > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Manveru <ma...@ma...> - 2018-10-09 15:50:36
|
Geez, people. Use: response().out() << R" <https://en.cppreference.com/w/cpp/language/string_literal>html(<a href=" https://www.googl.com">Google</a><br>)html"; It's it neater? czw., 20 wrz 2018 o 17:07 Asog <ret...@gm...> napisał(a): > This works too, but not sure about neatness: > > response().out() << "<a href='" << "https://www.google.com" << > "'>Google</a><br>"; > > On Thu, Sep 20, 2018 at 10:59 PM Nazim Can Bedir < > naz...@ne...> wrote: > >> Hi, >> >> You forgot that you are writing code in C++, so you need to start and end >> string literal with " (double quote), and escape the inner quotes. >> >> response().out() << "<a href=\"https://www.google.com\">Google</a>"; >> >> Regards, >> Nazim Can. >> >> -- >> С уважением, >> Назым-Джан Бэдир >> >> 18:24, 20 September 2018, "hoang nguyen via Cppcms-users" < >> cpp...@li...>: >> >> Nazim, >> I tried the following code as you said and it failed: >> >> response().out() << <a href="https://www.google.com">Google</a>; >> >> What am I missing? >> -------------------------------------------- >> On Thu, 9/20/18, Nazim Can Bedir <naz...@ne...> wrote: >> >> Subject: Re: [Cppcms-users] How to link external URL with CppCMS? >> To: "cpp...@li..." < >> cpp...@li...> >> Date: Thursday, September 20, 2018, 5:07 PM >> >> Hello, >> 'url' template command is >> used to output address of url_mapper routes. If you want to >> create link for an external URL, you just need to use usual >> HTML; i.e. >> <a >> href="https://www.google.com">Google</a> >> Regards,Nazim Can. >> >> -- >> С >> уважением, >> Назым-Джан >> Бэдир >> >> 12:45, 20 >> September 2018, Asog >> <ret...@gm...>: >> >> >> Hello, >> I got my CppCMS page >> working following this >> tutorial >> (full >> code). However, it >> doesn't show how to link to an outside URL (i.e., >> www.google.com). >> Can someone point out to me how it can be done? TIA. >> >> >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> -----Inline Attachment Follows----- >> >> >> -----Inline Attachment Follows----- >> >> >> >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Manveru jabber: ma...@ma... gg: 1624001 http://www.manveru.pl |