Skip to content

Instantly share code, notes, and snippets.

View l34marr's full-sized avatar

TsungWei Hu l34marr

View GitHub Profile
@l34marr
l34marr / main_template.pt
Created October 26, 2012 04:36
Sunburst main_template Page Template
<metal:page define-macro="master">
<tal:doctype tal:replace="structure string:&lt;!DOCTYPE html&gt;" />
<html xmlns="http://www.w3.org/1999/xhtml"
tal:define="portal_state context/@@plone_portal_state;
context_state context/@@plone_context_state;
plone_view context/@@plone;
lang portal_state/language;
view nocall:view | nocall: plone_view;
dummy python: plone_view.mark_view(view);
@l34marr
l34marr / base.cfg
Created October 29, 2012 10:15
Plone Config Files
######################################################
# Base Configuration; this provides sane defaults
# for commonly used parts.
# ---------------------------------------------------
#
# Buildout instructions in this file are
# usually only changed by experienced developers.
#
# Beyond here there be dragons!
@l34marr
l34marr / carousel.css
Last active October 13, 2015 21:28
Products.Carousel browser/carousel.css updated for ChiNan Project.
/**
* slidingPanels is similar to a horizontal accordion navigation, or holding
* some playing cards in your hand... sliding panels around to reveal one of
* interest.
*
* slidingPanels r1 // 2008.02.18 // jQuery 1.2.3+
* <http://cherne.net/brian/resources/jquery.slidingPanels.html>
*
* REQUIRES jQuery hoverIntent plug-in
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
@l34marr
l34marr / atctListTemple
Last active December 14, 2015 06:49
working with atctListTemple()
# Title: Helper method for temple folder view
# Parameter List: temples=0, subtemples=0, folders=0, images=0, subimages=0, others=0
# Bound Names: context, container, script, traverse_subpath
result = {}
is_topic = context.portal_type == 'Topic'
if temples:
if is_topic:
result['temples'] = context.queryCatalog(portal_type=('Temple',),
@l34marr
l34marr / city-town.py
Last active May 7, 2018 07:39
List Temple Data
cities = {
'KeelungCity': '基隆市',
'TaipeiCity': '臺北市',
'NewTaipeiCity': '新北市',
'TaoyuanCity': '桃園市',
'HsinchuCounty': '新竹縣',
'HsinchuCity': '新竹市',
'MiaoliCounty': '苗栗縣',
'TaichungCity': '臺中市',
'NantouCounty': '南投縣',
@l34marr
l34marr / plone.global_sections
Created April 2, 2013 10:32
zope.interface.interface-plone.global_sections
<nav id="mainMenu" class="tencol last">
<a class="toggleMenu" href="#" style="display: none;">Menu <span class="expandicon"><img src="http://talks.taishinart.org.tw/pic/menu-expand.png"></span></a>
<ul class="nav" tal:define="root_url context/@@plone_portal_state/navigation_root_url; isAnon context/@@plone_portal_state/anonymous" >
<li class=""><a class="rootmenulink parent" href="#" tal:attributes="href string:${root_url}/event/info">藝術雷達<span class="eng-info" style="cursor: default">TS Art Radar</span></a>
<ul class="submenu">
<li class="menuitem"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/info">藝術動態</a> </li>
<li class="menuitem"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/talks">藝論紛紛</a> </li>
<li class="menuitem" tal:condition="python: not isAnon"><a class="menulink" href="#" tal:attributes="href string:${root_url}/event/advisors">推薦團</a> </li>
</ul>
@l34marr
l34marr / dropdown.css
Last active December 20, 2015 08:39
Responsive Menu Demo
/* main menu sticky setting */
#st-wrapper {
width: 100%;
margin: 0 auto;
}
#main-nav-holder {
height: 56px;
}
#main-nav {
@l34marr
l34marr / plonectl-debug.txt
Created August 3, 2013 09:23
Page (Document) Attributes
>>> dir(site.myfolder['page-one'])
['COPY', 'COPY__roles__',
'Contributors', 'Contributors__roles__',
'CookedBody', 'CookedBody__roles__',
'CreationDate', 'CreationDate__roles__',
'Creator', 'Creator__roles__', 'Creators', 'Creators__roles__',
'DELETE', 'DELETE__roles__',
'Date', 'Date__roles__',
'Description', 'Description__roles__',
'EditableBody', 'EditableBody__roles__',
@l34marr
l34marr / news-index_html.pt
Last active December 20, 2015 19:18
ChiNan Church News Folder Page Template.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="context/main_template/macros/master"
i18n:domain="plone">
<body>