Discussion:
[PacketFence-users] Hard code SMS Provider and hide Field
Brian Beckwith
2017-04-28 20:14:52 UTC
Permalink
Hi i have got a working PF ZEN version 7 server going and its working
great. I would like to Hardcode the SMS provider and hiide the field on the
HTML form. I searched this group and fond soulution but they seem to be for
earlier versions of Packetfence and dint seem to apply to version 7. I do
not have a signup.html or a guest.html my guess is there are being
generated by the template toolkit but i cant find out how its generating
the HTML code for the page.

If anybody could point me in the right direction that would be great.
Torry, Andrew
2017-05-03 11:28:51 UTC
Permalink
In the signup.html (or signin.html) file in the profile folder (or via the GUI):-
replace:-

[% IF sms_carriers %]
[% out = form.get_field("mobileprovider").options(sms_carriers) %]
[% END %]

With:-

<div hidden class="input-container">
<div>
<label for="fields[mobileprovider]">Mobile provider</label>
<select name="fields[mobileprovider]" id="fields[mobileprovider]">
<option selected value="ID CODE OF PROVIDER" id="fields[mobileprovider].1">NAME OF SMS PROVIDER TO DISPLAY</option></select>
</div>
</div>

And also you need to suppress the display with:-

After:-

[% FOREACH field IN fields.keys %]
[% NEXT IF field == 'aup' %]

Add:-
[% NEXT IF field == 'mobileprovider' %]

This will give you the default and hidden that you need-

Regards

Andrew


From: Brian Beckwith [mailto:***@gmail.com]
Sent: 28 April 2017 21:15
To: packetfence-***@lists.sourceforge.net
Subject: [PacketFence-users] Hard code SMS Provider and hide Field

Hi i have got a working PF ZEN version 7 server going and its working great. I would like to Hardcode the SMS provider and hiide the field on the HTML form. I searched this group and fond soulution but they seem to be for earlier versions of Packetfence and dint seem to apply to version 7. I do not have a signup.html or a guest.html my guess is there are being generated by the template toolkit but i cant find out how its generating the HTML code for the page.

If anybody could point me in the right direction that would be great.





Andrew Torry

Senior Infrastructure Engineer



Tel: 01326 370760

Email: ***@fxplus.ac.uk




[cid:***@6fc5bb8e.448bde3c]
[Falmouth Exeter Plus] [cid:***@64b29399.41aea21b]


[Twitter] <https://twitter.com/falmouthexeter> [Facebook] <https://www.facebook.com/falmouthexeter> [Instagram] <https://www.instagram.com/falmouthexeterplus/> [YouTube] <https://www.youtube.com/channel/UC5-Jq4vTOhWgYoJJDYrZHWw>

[cid:***@b7566ad4.46811238]


[Falmouth University]

Falmouth Exeter Plus is an exempt charity established by Falmouth University and the University of Exeter to deliver their shared Higher Education services in Cornwall.
Loading...