Page 1 of 1

in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 8:34 am
by niedian
Hello, in Flowcode Web programming, how do you add multiple web pages? Greeting!

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 9:04 am
by Steve-Matrix
Currently, the best way is to create separate web apps for each page.

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 9:32 am
by niedian
In this case, to create links or redirects between pages, you would need to set up additional links via an intermediary page that you have pre-established.

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 10:14 am
by Steve-Matrix
Not necessarily. You could have links in your own Web Developer app just as easily. For example, see the attached project.

On the panel I have added a single label called "lblWebLink". This has no text, but I have given it a background colour so you can locate it. I have used a trick in the "Custom Attributes" property to turn this into a link. This property puts custom text into the <div> tag for the object and allows you to extend its behaviour using extra html attributes or elements.

To create this link, I have entered the following:

Code: Select all

><a href='https://www.flowcode.co.uk'  target='_blank' rel='noopener noreferrer'>click this link</a
When this is added to the <div> tag of the label in the generated page, it first closes the <div> tag and then adds a new <a> element with that actual link and corresponding text. The 'target' and 'rel' entries force the link to open in a new tab.

When this Custom Attribute property is added to the html output, we get something similar to the following:
new_a_tag.png
new_a_tag.png (15.76 KiB) Viewed 18414 times

I have highlighted the text from the Custom Attributes so you can see how it combines with the normal Flowcode-generated object.

Note that the link itself could be relative - e.g. href='./page1.html' - which would allow multiple Web Developer apps to open each other.

To make this easier, I will try to find the time to create a new component for creating a link like this.

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 12:00 pm
by niedian
Why is it written like this?
><a href='https://www.flowcode.co.uk' target='_blank' rel='noopener noreferrer'>click this link</a

Rather than writing it this way?
<a href='https://www.flowcode.co.uk' target='_blank' rel='noopener noreferrer'>click this link</a >

Regards.

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 12:05 pm
by niedian
Oh, looking at your post again, I think I understand now, thanks!

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Thu Aug 08, 2024 12:27 pm
by Steve-Matrix
The first ">" closes the 'div' tag and then the final "/a" is left open. This is because Flowcode puts this custom text within the "<div .... >" tag.

I have made the attached component which should make this easier. To try the component:
  • Browse to this location using file explorer (copy it into the address bar)

    Code: Select all

    %ProgramData%\MatrixTSL\FlowcodeV10\Components
  • Place the attached component.
  • Open Flowcode and open or create a new Web Developer project
This component is unofficial at the moment, but we will add it probably next week once we have tested it further.

Re: in Flowcode Web programming, how do you add multiple web pages?

Posted: Sun Aug 11, 2024 11:42 am
by niedian
I gave it a try, and it's very convenient, super awesome, thumbs up!