Skip to content

981 meetthedev ad#155

Open
adriennedao wants to merge 4 commits intodebugacademy:developfrom
adriennedao:981-meetthedev-ad
Open

981 meetthedev ad#155
adriennedao wants to merge 4 commits intodebugacademy:developfrom
adriennedao:981-meetthedev-ad

Conversation

@adriennedao
Copy link
Contributor

No description provided.

'#type' => 'fieldset',
'#title' => $this
->t('Meet The Dev'),
'#default_value' => $config->get('meetthedevblock_display'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Fieldset is just a visual grouping for form elements, so it does not have a value. Therefore you should not set a default_value for the fieldset item.

'#type' => 'textfield',
'#title' => $this
->t('Name'),
'#default_value' => $node->title,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have set default_value twice for the title; this line should be deleted.

'#type' => 'textfield',
'#title' => $this
->t('First Services Offered'),
'#default_value' => $node->title,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've set the default_value twice for this item, this line should be deleted.

<div class="meetthedev-titles">
<h2>Meet the Dev</h2>
<h3>Reed Richards</h3>
<h3>{{ meetthedevblock_title }}</h3>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good.

<div class="meetthedev-icons">
<img src="{{ base_path ~ directory }}/images/angular.png" alt="Angular logo">
<img src="{{ base_path ~ directory }}/images/drupal7.png" alt="Drupal 7 logo">
<img src="{{ base_path ~ directory }}/images/wordpress.png" alt="Wordpress logo">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user should also be able to specify the icons using the configuration form. You can add an image upload field to the configuration form which accepts multiple values, then here you can loop through the values they entered and print them.

$testimonial_block = views_embed_view('testimonial', 'block_1');
$testimonial['testimonial_block'] = $testimonial_block;

$meetthedevblock_block = views_embed_view('meetthedevblock', 'block_1');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

views_embed_view is for displaying views (which is right for testimonials and blogs), but meet the dev is not a view, it's only a block. Look right below this at 'services_block', because that's a block being loaded programmatically.

And after you load the block, you should pass it to twig (see how services_block, portfolio_block, blog_block are all passed to the twig files). Then in the homepage twig file you would print the meetthedev block using that variable when appropriate.

"drupal/core": "~8.5",
"drupal/default_content": "^1.0@alpha",
"drupal/pathauto": "^1.1",
"drush/drush": "^9.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better if this were not committed as part of this pull request, but because you at least did commit it in a separate commit, it is not a big problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants