Missing file name suggestions using views module - drupal-views

I have been working on a Drupal 8 theme using views module. For some reason, the module fails to display the list of file name suggestions.
At first I believed that the problem was sole in displaying the suggestions. However, after creating a new template file, following the pattern (views-view-unformatted--news-article-listings.html.twig), and rebuilding the cache, the file is ignored.
The picture bellow is the output of the twig file with debugging turned on.
Any ideas?

I know this is an old issue, but readers may be interested in this issue
https://www.drupal.org/project/drupal/issues/2923634#comment-12417950
Core Views does not currently supply theme suggestions in Drupal 8
The fix is being worked on, but the patch in #8 worked for me (v 8.5.5), and I can now see views theme suggestions 

I think that theme suggestions from views module are buggy. Now Im doing project, where there is none of them:
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'block' -->
<!-- FILE NAME SUGGESTIONS:
* block--mdb-content.html.twig
* block--system-main-block.html.twig
* block--system.html.twig
x block.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/mdb/templates/block/block.html.twig' -->
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'container' -->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/form/container.html.twig' -->
<div class="views-element-container">
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view' -->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/views/views-view.html.twig' -->
<div class="wrapper js-view-dom-id-8f70d5c8af23f92729c2180de609f1a2df672d7711b56b0a606853692ee787cd">
You can see, that file name suggestions works well on top, but under views_view hook i dont see any. But we can remember how they should look from Drupal 8 documentation:
View, named foobar. Style: unformatted. Row style: Fields. Display: Page.
views-view--foobar--page.html.twig
views-view--page.html.twig
views-view--foobar.html.twig
views-view.html.twig
views-view-unformatted--foobar--page.html.twig
views-view-unformatted--page.html.twig
views-view-unformatted--foobar.html.twig
views-view-unformatted.html.twig
views-view-fields--foobar--page.html.twig
views-view-fields--page.html.twig
views-view-fields--foobar.html.twig
views-view-fields.html.twig
https://api.drupal.org/api/drupal/core%21modules%21views%21views.theme.inc/group/views_templates/8.2.x

Related

How to emit the server path to the current file using Sightly?

I have some components that I've broken into multiple smaller files. The main file includes them using data-sly-include attributes.
I'd like to generate HTML comments containing the current filename in both the main file and the included files, so that when I view the rendered output I can easily tell which file generated the output. Something like:
... some HTML from the template or other components...
<!-- begin /path/to/main/file.html -->
<div>
This is from the main file
<!-- begin /path/to/main/includes/first.html -->
<p>This is fromt the first include</p>
<!-- end /path/to/main/includes/first.html -->
<!-- begin /path/to/main/includes/second.html -->
<p>This is fromt the second include</p>
<!-- end /path/to/main/includes/second.html -->
now we're back in the main file
<!-- end /path/to/main/file.html -->
I can see how to get the path to the current page, but that's the resource that contains my component; I want the paths to the files that make up the components. Any way to do this in Sightly?
the sightly script engine has the current file as a binding variable with sling, so the following should work-
sling.getScript().getScriptResource().getPath()
you will have to put this in a js file and call it from all your sightly scripts.

Can I use css3 in my Birt Report?

I want to use CSS3 in my Birt Report. But its showing the problem of CSS2.
A BIRT exception occurred.
Plug-in Provider:Eclipse BIRT Project
Plug-in Name:BIRT Model
Plug-in ID:org.eclipse.birt.report.model
Version:4.3.1.v201308301349
Error Code:Error.StyleSheetException.SYNTAX_ERROR
Error Message:There are some syntax errors inconsistent with CSS2.
So can anyone help me like how can I use my CSS3 file for my report. Is there any plugin or some steps then please let me know.
You can use css3 in html format only, by including the css file at viewtime. But it would be ignored by pdf & other formats.
For example, we are going to include this jquery-mobile theme at viewtime:
//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.css
To test this example, add a BIRT text element in the report, set type to HTML and include fragment below:
<button data-icon="star" data-theme="a" data-form="ui-btn-up-a" class=" ui-btn ui-btn-a ui-icon-star ui-btn-icon-left ui-shadow ui-corner-all">Button</button>
Run the report, you will see a great jqueryMobile-like css3 button!
You can also load the external files in the clientScripts of the report using head.js. For example, in a report's clientScripts > clientInitialize event, add:
head.js("http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js",
"http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css");
In the XML source, this appears as the last line in the following code.
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 4.4.0.v20150206-1039 Build <4.2.3.v20150206-1039></property>
<property name="units">in</property>
<method name="clientInitialize"><![CDATA[head.js("http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js", "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css");
]]></method>

CQ5 column control generated html

We are working on a project where we need a decent level of control in CSS to implement the design but have been told by the dev team that the generated html is:
<div class="parsys_column cq-colctrl-lt1"> <!-- "cq-colctrl-lt1" defines width of child divs (33%) -->
<div class="parsys_column cq-colctrl-lt1-c0"><!--another components go here --></div>
<div class="parsys_column cq-colctrl-lt1-c1"><!--another components go here --></div>
<div class="parsys_column cq-colctrl-lt1-c2"><!--another components go here --></div>
</div>
<div style="clear:both"></div>
Looking into column controls I see you can change the cq-colctrl- class but I can't find answers to the following:
1, Can the clear both div (generated by CQ) be removed or only shown in author mode?
2, Can the column control be added within a component?
3, Can the column class be set per component or is it a global setting?
4, Can you control the styles of the column classes and override the generated CQ5 CSS (eg for a responsive site?)?
If you want embed column component in your component:
go crxdelite in the /apps/geometrixx-outdoors/components/colctrl
just create package via site admin and specify the above path and download package then you can see, how column component is created.
http://jenikya.com/blog/2013/01/editing-column-widths-in-cq5.html
but it's better look at that path is more clear.

dhtmlx combo, autocomplete mode, js

I am having problem with autocomplete mode with dhtmlx combo.
The includes files are as follows:
// Images
<script>
window.dhx_globalImgPath="combo/dhtmlxCombo/codebase/imgs/";
</script>
// CSS
<link rel="stylesheet" type="text/css" href="combo/dhtmlxCombo/codebase/dhtmlxcombo.css">
// Required JS files
<script src="combo/dhtmlxCombo/codebase/dhtmlxcommon.js"></script>
<script src="combo/dhtmlxCombo/codebase/dhtmlxcombo.js"></script>
<script src="combo/dhtmlxCombo/codebase/ext/dhtmlxcombo_extra.js"></script>
I have no issues with the code above and works well.
The following code I have on the page I have the combo itself is as follows:
<!-- HTML Combo -->
<div id="pickup" style="width:260px;"></div>
<!-- Initialisation of combo -->
<script>
var x = new dhtmlXCombo("pickup",260,"image");
// this works
x.loadXML("list.xml");
x.enableFilteringMode(true);
</script>
My problem is i want to use autocomplete mode by using the following line of code:
x.enableFilteringMode(true, "list.xml", true, true)
When i try the above line, it doesnt give error but it doesnt filter either. However im told to use a php file but i don't know what I need to put in the list.php file itself. I can code just dont know what to put in. Can anyone shed some light, the docs arent that helpful.
enableFilteringMode enables server-side filtering. It means that when you type something in the combo header, this text is sent to the script that is defined the second parameter of the method. The script generates XML with options that correspond the mask.
Therefore, you can't use static XML in this case.
You can find a demo of the dynamic loading in the dhtmlxCombo package:
dhtmlxCombo/samples/04_filtering/01_combo_big_db.html
Also, you can use dhtmlxConnector that provides a ready solutions for the server side (PHP, ASP.NET, etc.). The dhtmlxConnector package includes a demo with dhtmlxCombo, e.g.:
dhtmlxConnector_php_v10_110725/php/samples/combo/02_sql.html

How do I update an Eclipse template variable on the fly?

I've added the following new Eclipse template via extension point. It simply adds a template for a sample testTag tag.
<!-- Add code template -->
<extension point="org.eclipse.ui.editors.templates">
<template autoinsert="true"
contextTypeId="html_tag"
description="[Description] Template populated by Snippet values ***"
id="org.eclipse.jst.jsf.ui.newHtmltag"
name="testTag">
<pattern>
<![CDATA[
<testTag style="background: ${color}"></testTag>
]]>
</pattern>
</template>
<resolver
contextTypeId="html_tag"
type="src"
class="TestTagTemplateVariableResolver">
</resolver>
</extension>
What I'd cannot figure out is how to change the value of the $(color) variable at runtime. More specifically, when the user presses Ctrl + Space (or the equivalent for content-assist) and types in "testTag" and presses Enter -- instead of the "color" placeholder text, I'd like it replaced by some other text value I have in another class. How do I do this?
This email chain from 2004 says it might not be possible:
the Java editor chooses not to respect resolvers contributed to its two context types ('java' and 'javadoc'), but only recognizes the built-in resolvers.
The html editor you are working with may have a similar restriction.