Add some code to template if a field is filled in and not if empty.

Hi,

Creating a Drupal 8 website and creating a theme for it (twig templates).

My problem:

I have a field (link URL) where my client can fill in a url-link OR NOT.
Depending if this field is filled in I wanne show a button on the front-end OR NOT.

1. When the field is filled in I want to add some code (a-tag and fixed title) with the URL in my twig template.
2. But if the field is not filled in... the code in the twig template should not be active (appear in source code for visitor).

Drupal 8 REST API to get the draft revision of a published page

For Drupal 8 (v8.3.7), you can use its RESTful Web Services module to add the REST export view. This way you will be able to have a REST API to get all pages and articles.

Suppose we have a page called AboutUs, we can get its content via the API:

How to print raw data in twig file.

Is there a way to print raw data in template files of Drupal 8. I know that in drupal 7 we can print and see the available variables from tpl.php files and decide how to use the values to print inside template files.

In Drupal 8, I used Kint or Dump. But i am not getting the data alone to decide how to print the data inside twig. I can understand that this is not as simple as D7. Some times Kint or Dump kills the whole page by loading too much of data.

Is there a simplified way.

MCA Denver

MCA Denver sought to create a digital experience that is a direct extension of their unique, vibrant identity as a custodian of creative life in Denver, Colorado.

Located in the heart of LoDo, Denver, the museum promotes creative expression, risk-taking, and experimentation through rotating exhibitions and innovative community events. Its exhibitions feature a broad range of work from regional, national and international artists. Its adult and teen programs are refreshingly thought provoking – and a ton of fun.

Sectors: 
Arts
Non-profit

htaccess Confusion...

Hey,

I have a situation going on that I can't figure out.

1 - Next week I have a site going live. It lives on the same server as current site.

Current site: mydomain.com/LiveSite/homepage
New site: mydomain.com/NewSite/homepage

2 - The OLD site is straight php. The NEW site is DRUPAL 8.

2 - OUTSIDE of those subdirectories is an htaccess that directs domain to proper folder and ignores the subdirectory;
To illustrate:

Relative links for domain-based multilingual content in D8

I have a reverse proxy server (Nginx) used for a Drupal 8 server. The Drupal 8 server has two languages, each assigned to its own sub-domain. The idea is that the proxy server geo-locates the users and, from the same main domain, provides the related upstream sub-domain. I have this working.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x