Laravel Nova how to add a live counter to text field - php

I'm using the Nova Admin panel for my Laravel application.
I have defined and added a new resource where the admin is supposed to fill out some text fields. One of those fields is a meta-title eg. meta description. So far so good, but I want to add a live counter to show the length of the string which is been entered to the textfield.
How can I achieve this?

There is a ext package that make this possible, i don't know if I can post this here with link. But if you search "Charcounter" as novapackage you find it.

Related

How to update the filters from the Venia store-front like the Magento front view?

Good afternoon everybody,
I am kind of a rookie using magento and I need help with this:
This are the filters from Magento front View, this filters can change position changing the position attribute in the magento/admin page.
enter image description here
this are the filters in the Venia-storefront:
enter image description here
As you can see there are not in the same position. So my question is, is there any way to connect what its happening to the position in the Magento front to affect the Venia-Storefront equally?
Can anyone help me with this?
Updating a little bit:
What I tried was to extend my graphql schema to have that position value & I did it, here is a photo of the schema:
When I use the query in the graphql playground I got the attribute correctly:
I got even the correct attribute in the json in venia-frontpage:
But as you can see the value is null.
If you go to the web admin page in magento, you can see that they have values in the position attribute:
Is there any way to grab that data in the admin and take it to the position value in the schema?
I have to change the resolver? what can I do to accomplish this?
here are the photos of the resolver:

Adding a CustomField to Infusuionsoft contact

I am trying to modify an existing integration with Infusionsoft that uses the Novak Infusionsoft PHP SDK.
The config.php file has a few custom fields defined in config.php like
//To Add Custom Fields, use the addCustomField method like below.
//Infusionsoft_Contact::addCustomField('_LeadScore');
Infusionsoft_Contact::addCustomField('_FooBar');
Infusionsoft_Contact::addCustomField('_BarFoo');
and that all works. I want to add another custom field for a text field named "Best Describes Me" in Infusionsoft and added what I thought would be the appropriate line
Infusionsoft_Contact::addCustomField('_BestDescribesMe');
But putting that line in gets an error:
[NoFieldFound]No field found: Contact._BestDescribesMe Attempted: 1 time(s).
I have been searching to see if there is anything else to be done either in the PHP toolkit or in Infusionsoft, but cannot find anything. I would actually expect that I have to do something in Infusionsoft to make the custom field externally available, but cannot find anything about that.
Any help would be greatly appreciated.
I fid find the solution. The actual field name in Infusionsoft may not be the same as what is displayed. You have to dig into the Backend Database Names for Custom Fields as described on this page:
http://help.infusionsoft.com/related-articles/backend-database-names-for-custom-fields
Go to Admin > Settings in the main navigation menu
Go to the custom field section, select a field type from the drop-down, and then click on Go.
Click on the View the field database names (for the API ) link.
The database field names will be listed in a new window.
The backend name is what needs to be put into the SDK config.php

Need a wordpress plugin for store and show trainee information in grid view

For a training center website i need a wordpress plugin that can store trainee information like name, batch no, phone no, email and a picture. That i can show in a page in grid view. please suggest me some wordpress plugin or any other way that i can do it. Thanks in Advance.
If you must use WordPress for this (not ideal) then one way is to register your trainee as a user and use a user meta plugin such as Meta Box to add additional fields to the user page: https://wordpress.org/plugins/meta-box/
Then use the get_user_meta function to retrieve the stored values and display them on a page: https://codex.wordpress.org/Function_Reference/get_user_meta
My favourite way is with custom post types. It might be a bit more work than installing some plugin and forgetting, but you are in control of everything and can adjust your code as needed.
Generate code for post type - https://generatewp.com/post-type/
Add it to your functions.php
Install ACF - https://wordpress.org/plugins/advanced-custom-fields/
and add the fields to your custom post type.
Add some users from the admin to the trainee post type
Select your trainee users and print them out.
Some links that might be usefull:
Post type templates so you can print out all trainees on trainy archive page - https://codex.wordpress.org/Post_Type_Templates
(You can skip this and add the post selection loop and printing out in some other page.)
How to get yout trainee posts - https://wordpress.stackexchange.com/questions/6417/query-for-custom-post-type
ACF get_field() function to get custom post data https://www.advancedcustomfields.com/resources/get_field/

Display custom field tabs in front end article edit page in Joomla 3.x

I have been looking for a solution to display custom field tabs in the Joomla
front article edit page.
http://www.aixeena.org/extensions/aixeena-easy-cck
Aixeena Easy CCK
I installed the plugin of aixeena, two custom field tabs: the Extra content and Extra content 2 are displayed in the backend admin article edit page, which is great. But we also need to let regular edit their article and enter values in custom fields under those two tabs. Any idea how to achieve this?
I tried a couple of other sites posting the solution of adding custom fields in article, such as Rating region described in the site:
https://docs.joomla.org/Adding_custom_fields_to_the_article_component
I was not able to make the Rating tab displayed in the front end article edit page neither.
I tried the fieldattach, it does supports custom field tab ( which is the group name of custom field), the list field type only contains static values, we have to define fieldset and field type through xml file.
Any help is greatly appreciated.
I just finished writing a couple pluginsto do this similar thing. I wrote my own plugin to add the extra fields - but it looks like the one you've already used is very similar.
I had a really hard time figuring out how to add the fields for frontend editing as well. But I finally figured it out.
First, you're going to need to copy the com_content form edit.php into a template override (/templates/your_template_name/html/com_content/form/edit.php).
In that file, add the extra fields you have. You'll need the name of the field that you put in the xml file for your plugin you already have. Add them right before/after the fields that are already in the file, that you want your fields to appear before/after. Example:
<!-- CUSTOM begin custom fields -->
<?php echo $this->form->renderField('video_url', 'attribs'); ?>
add all your fields in there - replacing 'video_url' with your own field name. The plugin you already have already saved these fields to the 'attribs' part of the article, so you can leave that there.
The plugin that I used to create the fields for the backend is a really simple one based off of this tutorial https://zunostudios.com/blog/development/203-how-to-add-custom-fields-to-articles-in-joomla
What I'd suggest is to go ahead and create that plugin too. Except in the zfields.php file, change "$app->isAdmin()" to "$app->isSite()" - make sure the xml files have the same names as your other plugin xml files, so they save to the same place, and you're done. The fields will show up on the frontend edit form now.
What I'd really recommend is to get rid of the Aixeena plugin, and just make that easy plugin using the tutorial above - it's super easy. When you make it, duplicate the "if ($app->isAdmin())" section, copy it right below it, and change "isAdmin" to "isSite" - and now you've got the entire thing, all your custom fields, both frontend and backend, all in one place. Now just do the edit.php template override, and you'll have them displayed in both the front and backend. I hope that helps - if you need I can upload more example code.

Wordpress - display media on page

A client wants a full page full of PDFs, and an option to be able to assign a PDF to a page automatically.
For example, conveyancing.pdf would appear on downloads.php (along with several others), but also have an option to tick 'yes I want this PDF to also feature on the conveyancing page'. Is this possible, and if so how would you approach it?
If I made a custom post type for the pdfs, is there an option to list all the pages it can appear on, like you'd tick categories but this would be 'pages'?
"a full page full of PDFs"?
Do you mean a page with links to multiple PDFs on the server?
Chrome / firefox and maybe IE have a built in PDF viewer and there is an option to save, download or print.
How to Upload & Link to a PDF file in WordPress
if i get you right, you want to upload pdf files from the admin panel and attach them to pages.
since you didn't specify what you already done, i will start from the beginning.
I've done this before on some project, i needed to let a client upload documents to post type page and custom post types. you can create a new custom fields on your code if you like too but i think if you'r out of time, you can installed for example the WCK plugin because besides of options like create new custom post types or taxonomy easily, it also let you create custom fields with repeater (which is not freely in every other good custom field creator plugin).
create with the plugin a new meta box and then the document field (you will need to do it for each post type). after that, you will see the new custom field on the post type you've been chosen, upload a document for the test and on you theme code call to get the field, check this link to get the detailed instructions.
after it will work for you you will want to add an option to attach some documents to other page by some checkbox right? you can create another custom field (checkbox) under the same meta box so it will Appear with every document field and then get the value on the code theme to check if it checked or not, that way you can control what documents will appear in the template you want to get by the checked checkbox of document ("show this document in other templates").
the problem with this should be how to get the id's of the pages who have the selected checkbox to the current page, i didn't try it but maybe you call all the pages with WP_Query and in the array use the specific post type you like and the custom field parameter to get only the pages with the check box, after that you can run a foreach on the array and use a condition to check for the value of each page checkbox, if it true get the custom field (document) and in the place to insert the post id use the id of the post in the foreach so it need to bring you the specific document. i would love to hear if it worked for you, good luck!

Categories