在某些页面上有条件地隐藏内容块的正确方法

时间:2017-02-21 15:39:12

标签: wordpress twig timber

隐藏的最佳方式是什么? Timber Twig模板中某些页面上的导航栏。尝试在

中包装导航栏元素
{% if post.title !== 'foo bar' %}
// show the nav
{% endif %}

但这不起作用。

1 个答案:

答案 0 :(得分:1)

你不能在树枝上使用public int offstX= 937; public int offstY= 520; bool isInited=false; void Update() { uint playerID; if(manager != null){ playerID = manager.GetPlayer1ID(); }else{ playerID = 0; } if(playerID <= 0) { //reset all the position to the initial values if (transform.position != initialPosition) { transform.position = initialPosition; } //reset all the rotation to the initial values if (transform.rotation != initialRotation) { transform.rotation = initialRotation; } for (int i = 0; i < bones.Length; i++) { bones[i].gameObject.SetActive(true); bones[i].transform.localPosition = Vector3.zero; bones[i].transform.localRotation = Quaternion.identity; if (SkeletonLine) { lines[i].gameObject.SetActive(false); } } return; } //set the user position in space Vector3 positionPointMan = manager.GetUserPosition(playerID); */ float initialXposition = transform.localPosition.x; float initialYposition = transform.localPosition.y; float nextXposition=0; float nextYposition=0; KinectManager manager = KinectManager.Instance; // call the Kinect instance if (DepthImageViewer.Instance.jointColliders != null) { if (manager.Player1Calibrated && isInited == false) { isInited = true; Debug.Log("Kinect See Your hand"); transform.localPosition = new Vector2(0, 0); nextXposition = transform.localPosition.x; nextYposition = transform.localPosition.y; if (initialXposition != nextXposition && initialYposition != nextYposition) { Debug.Log("I moved the cursor the the initial pisition"); } else Debug.Log("Sorry I didn't translate the cursor"); } else if (manager.Player1Calibrated && isInited == true) { float XvalueAre = DepthImageViewer.Instance.jointColliders[11].transform.localPosition.x * 192.0f + 184430.4f; float YvalueAre = DepthImageViewer.Instance.jointColliders[11].transform.localPosition.y *108.0f + 58832.1f; Vector2 newPos = new Vector2(XvalueAre - offstX, YvalueAre - offstY);// - initialPosition ,DepthImageViewer.Instance.jointColliders[11].transform.position.z) - initialPosition; Debug.Log("Your Hand X position => " + DepthImageViewer.Instance.jointColliders[11].transform.localPosition.x); Debug.Log("Your Hand Y position => " + DepthImageViewer.Instance.jointColliders[11].transform.localPosition.y); Debug.Log("Your Converted Hand X position => " + XvalueAre); Debug.Log("Your Converted Hand Y position => " + YvalueAre); transform.position = newPos; } } else Debug.Log("Erreur remplir joints colliders "); } 。 您必须使用session_start(); putenv('GOOGLE_APPLICATION_CREDENTIALS=' .get_include_path().'/yourPath/client_secret.json'); define('SCOPES', implode(' ', array( Google_Service_Calendar::CALENDAR) )); $client = new Google_Client(); $client->useApplicationDefaultCredentials(); $client->setScopes(SCOPES); $client->setApplicationName("MasterSinge"); $service = new Google_Service_Calendar($client); $calendarList = $service->calendarList->listCalendarList(); $googleApievent = new Google_Service_Calendar_Event(); $googleApievent->setSummary('TEST!!!!!!!!!!!'); $googleApievent->setDescription('TEST : <b>Bloublou !!!!!!!!!!!</b>'); /*ajout d'un lien*/ $googleApievent->setLocation('TEST !!!!!!!!!!!'); $start = new Google_Service_Calendar_EventDateTime(); $start->setDate('2017-02-23'); $start->setTimeZone('Europe/London'); $start->setDate('2017-02-23'); $end = new Google_Service_Calendar_EventDateTime(); $end->setDate('2017-02-23'); $end->setTimeZone('Europe/London'); $end->setDate('2017-02-23'); $googleApievent->setStart($start); $googleApievent->setEnd($end); $calendarId = "yourGmailAdresse@gmail.com"; $createdEvent = $service->events->insert($calendarId, $googleApievent); echo $createdEvent->getId(); foreach ($calendarList->getItems() as $calendarListEntry) { echo $calendarListEntry->getSummary() . "\n"; // get events $events = $service->events->listEvents($calendarListEntry->id); foreach ($events->getItems() as $event) { echo "<br/>" . $event->getSummary() . ""; echo " ID : " . $event->getId() . "<br/>"; echo "***********************" . "<br/> "; } } $pageToken = $calendarList->getNextPageToken();

工作片段: https://twigfiddle.com/9l9lrc

EPiServer.*