Skip to content

Instantly share code, notes, and snippets.

View andyxmas's full-sized avatar

andyxmas andyxmas

View GitHub Profile
<#if entries?has_content>
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
<table class="pgrList table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Title</th>
<th>Primary Supervisor</th>
<th>Application Deadline</th>
@andyxmas
andyxmas / Course search page PGR search
Last active May 12, 2021 13:49
A Freemaker Application Display Template for Asset Publisher in Liferay, that outputs various fields from a specific piece of structured content, and usings datatables.net to make the table sortable and searchable.
@andyxmas
andyxmas / Contact Dropdown
Last active August 29, 2015 14:04
Output template for Contact Details
<form id="contact-drop">
<select name="titles">
#foreach ($cur_title1 in $title.getSiblings())
#set ($item-title1 = $cur_title1.getData())
<option value="$velocityCount" data-contact="$velocityCount">$item-title1</option>
#end
</select>
</form>
#if (!$title.getSiblings().isEmpty())
@andyxmas
andyxmas / Template
Created September 3, 2014 11:18
Country Pages
<div class="tabs">
<ul>
#if (($welcome.data != "") || ($ambassadors.data !="") || ($social-media-name.data !=""))
<li>
<a href="#welcome">Welcome</a>
</li>
#end
#if ($visit.data != "")
<li>
@andyxmas
andyxmas / Structure
Created September 3, 2014 11:21
Events
<root available-locales="en_GB" default-locale="en_GB">
<dynamic-element dataType="string" indexType="" multiple="false" name="Date_Style" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width="">
<dynamic-element name="optionycmh" type="option" value="1">
<meta-data locale="en_GB">
<entry name="label">
<![CDATA[Start date]]>
</entry>
</meta-data>
</dynamic-element>
@andyxmas
andyxmas / .lando.yml
Created January 4, 2018 20:43
wordpress lando
name: remadeagency
recipe: wordpress
config:
webroot: .
events:
post-db-import:
# Set PROD_URL and DEV_URL values in .env file
@andyxmas
andyxmas / input.scss
Created November 17, 2021 12:46
Generated by SassMeister.com.
@mixin test($color, $size) {
color: $color;
size: $size;
}
.test {
@include test(red, 16px);
}
@andyxmas
andyxmas / get-quote-state.liquid
Created June 26, 2023 07:45
Proposed update to quote_state for blocked customers.
{% comment %}
Based on the data in the quote metafield and the cart
Returns one of the following [states](https://app.shortcut.com/medaire-online/write/IkRvYyI6I3V1aWQgIjYzNDQyYTFkLWMzODItNGUxYi05MDkxLWFiODc4ZWM1M2Y4NyI=)
{% endcomment %}
{% liquid
assign state = 'quote_not_present'
assign quote = customer.metafields.quote.data.value
assign cart_uploaded_at = cart.attributes['Quote Uploaded At'] | plus: 0
assign uploaded_at = quote.uploaded_at | plus: 0
@andyxmas
andyxmas / gist:fb748f4a086c9ab6e7979761eaec37c1
Created July 24, 2023 08:27
display customer metafields
import { getIDFromGID, camelToSpace } from "../../../helpers/helper.jsx";
import {
BlockLayout,
Text,
useAppMetafields,
useCustomer,
Heading,
InlineLayout,
useTranslate,
import React, { useState, useEffect } from "react";
import {
Select,
useAppMetafields,
BlockStack,
useApplyAttributeChange,
useTranslate,
TextField,
useExtensionCapability,