[luci] add button conditionally

Jo-Philipp Wich xm at subsignal.org
Thu Oct 17 13:16:03 CEST 2013


Hey.

> Now the button is displayed on 3g network (in my example). How to make
> button to be displayed on all pages when proto is 3g (option proto '3g')?

Try something like:

<% 
   local uci = require "luci.model.uci".cursor()
   if uci:get("network", self.network, "proto") == "3g" then 
%>
     ...
<% end %>

~ Jow

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.subsignal.org/pipermail/luci/attachments/20131017/93a18d3e/attachment.pgp>


More information about the luci mailing list