This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

[SOLVED] Views template custom css

Hello,

i want to code my own views template with custom css class, based on field value. My field is a taxonomy term field and now i want to rewrite the outout of their values and use it as a css class. 

Here is my code: 

<div class='col-md-8 <?php $kat = $fields["field_kategorie"]->raw;
if($kat == 3) {
print "test";
}
else if($kat == 2) {
print "nodepo";
}
echo $kat; ?>'><?php print $fields['field_umsatzanforderung']->content; ?></div>

Adding JavaScript to Registration page

How do I add some JavaScript to the Registration page? Do I need a module with a form_alter in it testing for the for ID plus a node_view function to add in the JavaScript file? Thanks

How to create a 1:1 entity tied to the user.

I am a volunteer developer for the local Amateur Radio Emergency Services organization, and am trying to develop a website for them. The problem I have is that each user will have a large number of fields indicating what their capabilities and/or available equipment they have. This presents a problem with the Profile and Profile2 modules, in that they build very complex structures. I wish to create a custom entity/table with a 1:1 relationship to the user. This would help greatly with performance and reporting.

Render Drupal Content on a non Drupal Site

I am interested to know if it is possible to retrieve rendered twig content, js, and css, to be displayed on a non-drupal external site without using an iframe. I have looked into the following options but none seem to work for me:

Implementing the CommandInterface class and using the render method to retrieve the content. This approach seems to require the external site to be drupal as it would require the external site to have access to the drupal ajax commands. I used the following sources for this info.

FormBase submission with Ajax Textfield

Hello,

I'm creating a form with four fields .

The first is for 'reference' and when it's content change, make an Ajax callback for inserting text in the other fields issues from database requesting.

The 'reference' Texfield declaration in my FormBase php file :

Field referencing field values

Hi,

Is it possible to reference field values?

I want to add a field on content type that references another field values of another content type. How can I achieve this?

I tried creating an entity reference view but there is no field entity reference type. Should I create this kind of entity reference by code in a view plugin format?

The resulting field is a select list referencing a textfield values from another field of a content type.

Any ideas, suggestions or help is appreciated. Thank you very much!

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions