How do I get Mail.app to use a template?

It would be very convenient in macOS mail if clicking Answer, a simple template would:

  • Insert a "Hello [first name of recipient from original email]"
  • add my signature
  • quote the original email at the end (as usual)

Any extension of mail.app (plugins) that makes this feature simple?

react.js – React tabulated template

I made this simple application template with tabs and one thing in particular that I'm not sure about is my creation of a page map object. The idea behind this is that you can add a new page to the application by adding an entry in the page map as well as the list that is assigned to produce the tabs.

The components are from material-ui and, for brevity, I did not include the import / style model.

App () {function
classes const = useStyles ();
const [page, setPage] = useState (& # 39; Start & # 39;)

const pageMap = {
& # 39 ;: {& # 39; component & # 39 ;: , & # 39; icon & # 39 ;:  }
& # 39; Favorites & # 39 ;: {& # 39; component & # 39; , & # 39; icon & # 39 ;:  }
};

he came back (
Board
{['Home', 'Favourites'].map ((text, index) => ( setPage (text)} selected = {text == page}> {pageMap[text]['icon']} ))}
{pageMap[page]['component']}
); }

error – magento 2.3.1 – Invalid template file

Recently I have been working on a new website and I got an unfortunate error. When I click on a product on the catalog page, I get this error:

    1 exception (s):
Exception # 0 (Magento  Framework  Exception  ValidatorException): Invalid template file: Magento_Catalog :: product / view / product_info_main.phtml & # 39; in the module: & # 39; Ves_Themesettings & # 39; name of the block: & # 39; ves.product.info.main & # 39;

Exception # 0 (Magento  Framework  Exception  ValidatorException): Invalid template file: Magento_Catalog :: product / view / product_info_main.phtml & # 39; in the module: & # 39; Ves_Themesettings & # 39; name of the block: & # 39; ves.product.info.main & # 39;
# 1 Magento  Framework  View  Element  Template -> _ toHtml () called in [vendor/magento/framework/View/Element/AbstractBlock.php:668]
# 2 Magento  Framework  View  Element  AbstractBlock-> toHtml () called in [vendor/magento/framework/View/Layout.php:557]
# 3 Magento  Framework  View  Layout -> _ renderBlock () called in [vendor/magento/framework/View/Layout.php:533]
# 4 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 5 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 6 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 7 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 8 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 9 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 10 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 11 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 12 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 13 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 14 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 15 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 16 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 17 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 18 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 19 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 20 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 21 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 22 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 23 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 24 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 25 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 26 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 27 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 28 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 29 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 30 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 31 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 32 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 33 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 34 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 35 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 36 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 37 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:585]
# 38 Magento  Framework  View  Layout -> _ renderContainer () called in [vendor/magento/framework/View/Layout.php:535]
# 39 Magento  Framework  View  Layout-> renderNonCachedElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:206]
# 40 Magento  Framework  View  Layout  Interceptor-> renderNonCachedElement () called in [vendor/magento/framework/View/Layout.php:488]
# 41 Magento  Framework  View  Layout-> renderElement () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:193]
# 42 Magento  Framework  View  Layout  Interceptor-> renderElement () called in [vendor/magento/framework/View/Layout.php:954]
# 43 Magento  Framework  View  Layout-> getOutput () called in [vendor/magento/framework/Interception/Interceptor.php:58]
# 44 Magento  Framework  View  Layout  Interceptor -> ___ callParent () called in [vendor/magento/framework/Interception/Interceptor.php:138]
# 45 Magento  Framework  View  Layout  Interceptor-> Magento  Framework  Interception  {closing} () called in [vendor/magento/framework/Interception/Interceptor.php:153]
# 46 Magento  Framework  View  Layout  Interceptor -> ___ callPlugins () called in [generated/code/Magento/Framework/View/Layout/Interceptor.php:494]
# 47 Magento  Framework  View  Layout  Interceptor-> getOutput () called in [vendor/magento/framework/View/Result/Page.php:258]
# 48 Magento  Framework  View  Result  Page-> render () called in [vendor/magento/framework/View/Result/Layout.php:171]
# 49 Magento  Framework  View  Result  Layout-> renderResult () called in [vendor/magento/framework/Interception/Interceptor.php:58]
# 50 Magento  Framework  View  Result  Page  Interceptor -> ___ callParent () called in [vendor/magento/framework/Interception/Interceptor.php:138]
# 51 Magento  Framework  View  Result  Page  Interceptor-> Magento  Framework  Interception  {closing} () called in [vendor/magento/framework/Interception/Interceptor.php:153]
# 52 Magento  Framework  View  Result  Page  Interceptor -> ___ callPlugins () called in [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130]
# 53 Magento  Framework  View  Result  Page  Interceptor-> renderResult () called in [vendor/magento/framework/App/Http.php:140]
# 54 Magento  Framework  App  Http-> launch () called in [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
# 55 Magento  Framework  App  Http  Interceptor-> launch () called in [vendor/magento/framework/App/Bootstrap.php:258]
# 56 Magento  Framework  App  Bootstrap-> run () called in [index.php:39]

Any help would be greatly appreciated. Thank you

json – Changes to an existing php code for the twig template engine

I want to read the latest Invison Power Board threads with REST API.

I found a working PHP code, tested on my system with PHP 7.3.6, but I do not know how to use this code in Twig v2.10.0.

getRecentForumTopics () {function
$ communityUrl = & # 39; https: //domain.tld/&#39 ;;
$ apiKey = & # 39; 123 & # 39 ;;
$ endpoint = & # 39; / forums / topics & # 39 ;;
$ vars = & # 39 ;? sortDir = desc & perPage = 4 & # 39 ;;

$ curl = curl_init ($ communityUrl. & # 39; api & # 39 ;. $ endpoint. $ vars);
curl_setopt_array ($ curl, array (
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => "{$ apiKey}:"
));
$ answer = curl_exec ($ curl);
$ values ​​= json_decode ($ response, true);
$ data = [];
foreach ($ values['results'] as $ value) {
$ data[] = [
            'title' => $value['title'],
& Url & # 39; url & # 39; => $ value['firstPost']['url']
        
        
        
        ];
}
returns $ data;
}
eco & # 39;

Recent Topics

& # 39 ;; $ array = getRecentForumTopics (); eco & # 39;
    & # 39 ;; foreach ($ array as $ key => $ item) { eco & # 39;
  1. & # 39; $ item['title'].
  2. & # 39 ;; yes ($ key == 4) { break; } } eco & # 39;
& # 39 ;;

This is the existing PHP code in Twig.


    "first name",
// "User" => User :: GetData ($ _ SESSION['user_id'])
);

$ loader = new Twig_Loader_Filesystem (& # 39; templates / & # 39;);
$ twig = new Twig_Environment ($ loader, array (
& Cache & # 39; => & # 39; c_cache & # 39 ;,
& Debug & # 39; => & # 39; false & # 39;
));

echo $ twig-> render (& # 39; test.html & # 39 ;, $ data);

What do I have to change to make this code work in Twig?

8 – Direct individual elements of a multivalued field in my page template

There are many ways to achieve this. Since you use a custom theme or subtopic, you would follow the naming conventions of the Twig Templates and create your own. field - node - MYFIELDNAME.html.twig model. And then simply adjust the marking according to your needs.

See Classy field.html.twig For reference and your for loop you can simply customize:

{% for article in articles%}
  
    {{item.content}}
  
{% endfor%}

To point to the second element in a multivalued field within page.html.twig Use the following code fragment (start counting 0, so that 0 It is the first and one it is the second element).

{{node.field_MYFIELD.1.value}}