How to select one option from ist of dropdown option in ul class
I tried using select class
But I need the code for ul class
Related
I have a label "Inactive sites" in my django admin:
class InactiveSite(Site):
class Meta:
proxy = True
verbose_name_plural = 'Inactive sites (' + str(Site.objects.filter(is_active=False).count()) + ')'
I would like to format "Inactive sites" (change color, font size, etc.). How can I do that?
You can override Django's template for the admin page and include your own css file (preferred way) or directly add it to the html.
You can use the developer tools of chrome or firefox to identify what selector you need.
In Chrome CTRL+SHIFT+C and then click on the link text.
At the moment I only have a modified admin, for me the css selector is: #admin-home > ul > li > ul > li > a
See here: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates
The answer here has a code sample: https://stackoverflow.com/a/37317429/640916
Is there any way to assign menu icon for flask-admin generated category link?
We can set the icon for menu item via
menu_icon_type=ICON_TYPE_GLYPH, menu_icon_value='glyphicon-tags'
But I didn't see any such named parameter existing for category link.
This was recently added as a feature in this pull request: https://github.com/flask-admin/flask-admin/pull/950
Now you can use category_icon_classes when you initialize Admin, like this:
admin = Admin(
app,
name='My Admin',
category_icon_classes={
'Profiles': 'glyphicon glyphicon-wrench',
}
)
Sitecore 6.6 Update 4
We're using CustomItemGenerator 1.0 and I was using this to help build a primary navigation menu for a site. This worked as expected and everything was rendered properly.
My problem is when I attempt to edit the menu via Page Editor; I don't even see the menu.
I use a repeater and repeat over a list of links to include in the nav. Due to the way the HTML was created, each LI element needs to have its own, specific ID ("Nav Id" Field in Sitecore) that ties into the CSS. Code inside of my repeater's ItemDataBound event:
// Cast the item using CustomItemGenerator-generated class
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
liMenuItem.ID = navItem.NavId.Rendered; // I tried "navItem.NavId" by itself as well
So while this renders properly in the browser, it doesn't when I'm in Page Editor:
<li id="<input id='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' class='scFieldValue' name='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' type='hidden' value=" Home?="">
... instead of it rendering like this:
<li id="Home">...</li>
Now, that having been said, I can change my code to not use the CustomItemGenerator and it works fine in the browser and Page Editor as follows:
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
Item nav = Sitecore.Context.Database.GetItem(navItem.ID);
liMenuItem.ID = nav.Fields["Nav Id"].ToString();
I would like to avoid having to hardcode field names in my code, which is why I am using CustomItemGenerator. Is there something that I'm doing wrong with my code that it doesn't want to work in Page Editor?
Thanks!
If you need the actual value out of the field regardless of if you are in the page editor or not, you want to use the Raw property:
liMenuItem.ID = navItem.NavId.Raw;
I'm new to programming so this may be a trivial question...
In django-tables2, I'd like to be able to display the column header name when using CheckBoxColumn. Right now, all the checkboxes are displaying for each row, including in the header. I don't mind having a checkbox in the header (I figure that would be a great way to do a "select all" in the long run), but I need the column name to display. Does anyone have a solution for this?
Create your own custom checkbox column class that inherits from tables.CheckBoxColumn
then override the render method, then specify the check box together with its label as html response.
class CustomCheckBoxColumn(tables.CheckBoxColumn):
def render(self, value, record, bound_column):
return mark_safe(u'column Name<input type=checkbox, … />')
Another option is to use the TemplateColumn() instead of CheckBoxColumn()
template = '<input type="checkbox" name="{{record.name}}" />'
checkbox_column_header = tables.TemplateColumn(template)
i have a problem in adding select box dynamically in custom forms in foundation css framework.even if i add select within the form that have class name "custom".its added normal style select box only.
<pre>
var createdRow ="<tr><td><select><option value='1'>1</option></select></td></tr>";
jQuery('#roomsDetails tbody').append(createdRow);
</pre>
run this code after u added select
Foundation.libs.forms.assemble();
If you want to add style to the element, just use jQuery('option').addClass('some css class'); or jQuery('option').css('property', 'value');