Laravel backpack 4.1 Add anchor tag to table - laravel-backpack

How to make a link from a database field and display it inside the table?
Inside the protected function setupListOperation() the code for the link looks like this:
CRUD::column('link')->type('link');

You can use the wrapper attributes to turn that into an anchor. See the docs here - https://backpackforlaravel.com/docs/5.x/crud-columns#wrap-column-text-in-an-html-element

Related

How to add custom javascript in Laravel-Backpack

Is there any way to add custom javascript?
I want to add custom javascript to some of the pages but it seems i am not able to.
Each default Backpack operation has its own CSS and JS file, in:
public/vendor/backpack/crud/css
public/vendor/backpack/crud/js
If you don't find one there, you can create one, and Backpack will pick it up in that operation's view (e.g. create.css or list.js).
Read more: https://backpackforlaravel.com/docs/3.5/crud-how-to#customize-css-and-js-for-default-crud-operations

Display System Categories in TYPO3-FE

I am trying to build my first own extension with the Extension Builder. Up to now everything worked really well, but now I've got a problem and am not able to find a solution:
My extension looks like this: You can add new Entries in the backend under List (the entry on the right panel). These entries are then shown in the frontend.
While adding new entries there is the possibility in the horizontal navigation bar to link this entry to specific categories. I've already done this with every entry.
But how can I display this category in the fronted. It should be just one <div> like Linked Categories: CATEGORY.
It seems like there is no ViewHelper which can display all linked categories.
I've already googled a lot, but this just confused me more: It seems like its not possible with a simple ViewHelper. There was a solution, where one had to edit the controller. But I did not like this because then I can not continue working with the Extension Builder or it becomes overwritten.
I also looked in the code of tx_news. It seems like all categories are in a variable there, which can be looped. But in my extension <f:debug>{categories} was always NULL.
Is there no ViewHelper which can display the categories, or anything else? Maybe a good tutorial (I am good in PHP, but new to TYPO3).
Thank you very much in advance,
Felix
P.S: I am using TYPO3 CMS 7.6.9
the Extension Builder is just a 'kickstarter' that helps you define your models and actions, relations etc ... It will not do more then that. So once you created your extension draft, it's best to forget about the extension builder and try to understand the structure of an extbase extension (the MVC, TCA, localconfig, typoscript,...). If you need to add a new property, do it manually. You will learn a lot more about your extension and how it works.
Having this said, you will have to adjust your extansion yourself to add categories. There are a few ways to do it: you can add your own category system by adding your own category Model, or use the TYPO3 category API
https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.html
There is also no plug&play category viewhelper. If you like to be able to list your entries by category, you will need to adjust your controller.
You can add some functionality to an existing on, for ex. your listAction so that it reads arguments send to this action (a list of categories you like to filter on) or create a new one called for example categoryAction.
extbase reference :
https://docs.typo3.org/typo3cms/ExtbaseFluidBook/b-ExtbaseReference/Index.html
stackoverflow question about categories in a controller:
Controllers and Template (how to filter results correctly or give arguments via backend?)
bottom line:
- skip extension builder
- learn how to adjust the MVC yourself
you can always join the TYPO3 slack channel :
https://typo3.slack.com/
it's free and people are very helpfull
good lcuk

Display category and its content in TYPO3

I am using TYPO3 6.2.9 CMS.I make category and assigned to page.But I don't know how to display the category when i am showing the page i want all the category assign to that page must display then after clicking that category the content which i have assign to that category must display
There is no out-of-the box solution for this.
But you can use the following :
Or create your own extension where you gather the categories of your page and render them on your page. You then can also create a sort of category menu.
You can use category collection :
http://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/Categories/Index.html
cObject RECORDS has also a categories property, so you could also use typoscript for rendering.
For this purpose you can use extensions to your website.
Catalogue extension package
Which relates to categorisers and if you want to you can customize it in your own manner.
Use of these extensions make simple in listing category.
The usage is also given in its manual ans its simple to adopt it.

Want to display an auto generated id in a custom module of SugarCRM

I am using Sugar Enterprise 6.4.0 and want to display a uneditable field in a custom module Edit and Detail view. This id need to be generated automatcially and need to be displayed in the interface when user click to create a new record in the custom module.
Because i am new to Sugar can anyone help me out in performing this task. Any ideas?
You can set the readonly property on the field itself in the vardefs for the module...
$dictionary['<<module>>']['fields']['<<fieldname>>']['readonly'] = true;
Then, add some logic in the custom/modules/<>/views/view.edit.php which does the autogeneration for you.
I just did this, using an after_save_hook with code like(not exact):
$bean->name = $bean->id;
as soon as you save a record in sugar an id is generated automatically. Then I don't include the ID in the editview at all, just the detail and list views. I don't see any point in including it in the edit view as it is not editable.

Zend Form multiselect array

I am using the Zend Framework and have setup a normal Zend Form, what I want to try to achieve is to have a button (with some javascript) that says add more and it adds another drop down menu same as the one setup in the zend form (a clone of it).
basically when the button is clicked it adds another select box like so:
<select name="type[]"> ...</select>
I can do a copy of the multi select box with a different name and insert it in the DOM and catch the post from the controller outside of the Zend form but what I was wondering if there is a proper way to achieve this and be able to validate and populate the extra fields when editing a current data stored in db if there are any extra.. Any help is appreciated, thanks.
Well remember that in your controller if you have something like:
$this->form = new Form_Someform();
You can always do:
$this->form->addElement(etc...)
Right before using isValid() or populate.
So in your controller when someone submits the form, when creating your form object you could check if any select were created dynamicaly and then create corresponding Zend_Elements and just validate against that.
Also when you reload that form you just create elements depending on whats in your database.
You could also use the forms constructor to pass in an array of selectboxes and create then right there too. Thats what I do.
The important things to remember is that you have control on the constructor and on the form object between its creation and the use of the populate() and isValid() functions.
Hope this helps.