Html mix with livecode server

Alex Tweedly alex at tweedly.net
Sat Feb 11 15:44:34 EST 2023


Short answer .... you can use single quotes and double quotes 
interchangeably in HTML (so long as consistently).

So you can do

> <?lc
> If gErrText is not empty then
> Put "<div class='alert alert-danger' role='alert'"
> ?>
Second answer: Or, you could mix html + lc, and do

> <?lc If gErrText is not empty then ?>
> <div class="alert alert-danger" role="alert"
> <? end if ?>
Third answer: Or, for anything more complex like a full website, you 
might want to look at Ralf Bitter's excellent revigniter.com

Alex.


On 11/02/2023 18:05, Paul Richards via use-livecode wrote:
> Hi everyone,
>
> I've been using Livecode for a number of years, and have had no issues whatsoever - but recently thought I would give Livecode server a go.
>
> Using another webserver, I can do something like this where you can output true HTML. This example would check if username/password correct and display an error if not .
>
> $
> If  lError = true then
> Weboutput $
>
>                  <div class="alert alert-danger" role="alert">
>                                  <strong>sErrText</strong>
> <div>
> $
> Endif
> Weboutput  $
>
> Trying to replicate this in Livecode server isn't proving as "simple"
>
> I can see we need to use the put command, so tried the following:
>
> <?lc
> If gErrText is not empty then
> Put "<div class="alert alert-danger" role="alert"
> ?>
>
> but this simple line results in an error "
>
> row 84, col 31: put: preposition must be 'before', 'into' or 'after' (alert)
>    row 84, col 31: if: error in command (alert)
>    row 84, col 31: script: bad statement (alert)
> "
> Is there a way of outputting this line in HTML using the put command and without having to manipulate the line in true livecode script ie: put "<div class=" & quote & "alert   etc .  Where there are multiple if, else blocks  - that would be hard to read and cater for.  Or have I missed something obvious?
>
> Many thanks
> Paul
>
> ------------------
> Paul Richards
> Service Delivery Manager
> Smartt Software Ltd
> Tel: 01392 464596
> Mob: 07973 389794
> paul at smarttsoftware.co.uk<mailto:paul at smarttsoftware.co.uk>
> https://smarttsoftware.uk<https://smarttsoftware.uk/>
> https://equinox7.com<https://equinox7.com/>
> Sales: tel:+44(0)3333442524
> sales at Smarttsoftware.co.uk<mailto:sales at Smarttsoftware.co.uk>
> --------------------------------------------------------------------------------
> PRIVACY AND CONFIDENTIALITY NOTICE
> --------------------------------------------------------------------------------
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.
> It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, you must not disclose, copy, or take any action in respect of this transmission, but please notify our system manager by emailing support at smarttsoftware.co.uk<mailto:support at exetermicro.co.uk> and then destroy this message.
> The Internet cannot guarantee the integrity of this message or any attachments. Smartt Software takes all reasonable precautions to ensure that no viruses are transmitted with any electronic communications sent by us, however we can accept no responsibility for any loss or damage resulting directly or indirectly from the use of this E-mail or any contents or attachments.
> Smartt Software Ltd is a company incorporated in England & Wales Registration No. 02478683 and whose Registered Office is at 64 Fleet Road, Farnborough, GU14 9RA.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list