Overview of all fluidcontent FCEs - flux

For complex TYPO3 project using fluidcontent I'm looking for a tool, which show me the followering informations:
which FCE exists
how often and on what pages are they in use
which partials are used
which flux form fields are used (with name and type)
diposit some meta informations, e.g. tags, description ...
How would be the smartest way to implement this library in a typo3 project?
My idea is, to develop an extension which read the fluidcontent templates and show the informations in a frontend plugin with examples. But i have no idea to read out the information like "used partials" or "used flux form fields".
Any ideas?
Thanks.

FCE's are just cType elements in the tt_content table. you can write a simple query to count the different cTypes, thus gives you a list with all the used FCE's on your site. you can know on witch page they are used because every tt_content entry has a pageUId
for the flux fields. you will have to create a function that fetch all content elements that uses flux and then parse all the flexform fields. note that flux can also store data in other fields then flexform xml.
you can create a basic extbase plugin for this to show it in the front or backend

Related

How to create html element for each object in collection?

I have String like this:
{"response":{"count":997,"items":[{"id":2943,"first_name":"Vasya","last_name":"Babich","can_access_closed":true,"is_closed":false,"screen_name":"antanubis","track_code":"24fc13d6ZwhuhzyM9V1oRkohiruY-zXeoP1aliqA-1dA4qgxJrQAYSTQYe6kVWsTTKkXWWybQrHU"},{"id":231329886,"first_name":"Vasya","last_name":"Babich","can_access_closed":true,"is_closed":false,"screen_name":"lydka_lydka_lydka","track_code":"a348ab0aAo3CxaTAGsTDu4mpMdBMMjYxgAmOnr7PvUWgaanh141l5NGe_PlLz8a8unX1eOUxXj-GCo6esKk"}]}}
I want to show each value of "items" to user in browser and then user should be able to select one of them and save in database and in his own page in the website. I guess I should use loop and create html element for each item. But how to do this? What data type should I use to manipulate this data and store it?
Thymeleaf is the most widely used view/template engine with Spring Boot and can handle your loop requirement. Spring MVC enables you to manage your app behavior and define the data bound to HTML pages (views). You will need a database and there are lots of options. Check out Spring Data which makes it easy to work with all major database technologies.

How to use Vue js to filter Laravel data collection then render them?

I have a simple Laravel web site with à limited number of products (actually 15 smartphones) to display and there is no pagination needed. In the home page of the web site, ALL the products are automatically displayed.
My problem is that i would like the user can filter those data with à range filter on price, OS and more... So how can i use Vue js to filter data already returned from the database with Laravel Query builder by keeping SEO in mind ?
If your products are in the form of an array of objects, as a Laravel collection would be when serialised to JSON you can use a library like collect.js to filter your products in the same way as you would with Laravel collections.
The library is based off of Laravel collections actually has a near identical API, so you'll immediately be familiar with the available methods.
An example for your use case may be to filter e.g. OS:
import collect from 'collect.js';
return collect(products).where('os', 'Android').items;
A full listing of all of the available methods can be found on the project's GitHub README.

Include Order information in MailChimp Campaign?

We already have our customer's Order Information in MailChimp. It shows on the "E-Commerce" tab of each Contact in the List.
Is it possible to send out a campaign in MailChimp that includes this information?
For example, the customer's most recent Order Number?
Unfortunately, they don't yet have pre-built tool capable of pulling customer/order attributes into a Campaign's content, and at least currently adding any data like this you'd like to dynamically populate in Campaign would require adding any data directly to the list fields and using their merge tags.
http://kb.mailchimp.com/merge-tags/getting-started-with-merge-tags
They do offer Product centric dynamic content options, if that'd be in any way helpful.
Use Product Recommendation Content Blocks: http://kb.mailchimp.com/campaigns/content-blocks/use-product-recommendation-content-blocks?utm_source=mc-kb&utm_medium=kb-site&utm_campaign=eepurl
Merge tags for products: http://kb.mailchimp.com/merge-tags/all-the-merge-tags-cheat-sheet#Merge-Tags-for-Product-Recommendations
You can optionally store merge fields associated with each list recipient:
http://developer.mailchimp.com/documentation/mailchimp/reference/lists/merge-fields/
You could create a custom merge field for "MOSTRECENTORDER" for each customer, and then reference it within templates using |MOSTRECENTORDER|

Store translated versions in database for Joomla component

I'm currently developing my first MVC component for Joomla 3.x. All in all I'm bit struggling with language/translation issues in database.
My problem is that I need to store translated content of user generated content which comes from the backend. For example someone enters a new item in German (stored in database) and needs a translation in another language. How to accomplish that in Joomla? I don't like to generate a new item for every different language when the rest is all the same.
I thought about a table "item" and a table "item_language" with that structure (strongly simplified for viewing purposes):
item
id PRIMARY INT
price DOUBLE(4,2)
item_language
itemid PRIMARY INT
language PRIMARY CHAR(5)
name VARCHAR(50)
In item_language I would like to store the different translated versions. In the language field there would be the region code (eg. de-DE) to identify the language.
My problems:
How to display the different (translated) versions in backend?
Is this the right database model?
Any help is appreciated!
You have really found yourself a nice task for a first component in Joomla!
A rather generalist answer:
The database model seems right. Alternatively you could encode in JSON the language data, but this could make later query operations potentially difficult. This way you will only have one table to work with.
As far as I know (if you are using JModel / JTable to manipulate the data) can't do this directly, as JTable is really only designed to manipulate single tables.
What you can do:
For editing: figure a way to represent this graphically ( for your users to see and edit this one to many relationship) and to post this data (language texts as an array) to JModel. In the model you can maintain the desired relationships and save the data using JTable.
Viewing (without editing) shouldn't be an issue, it would be a simple JOIN.
If you are willing to create a basic component on github, I might even give you a hand with JModel / JTable.
I found a way to deal with the things I needed.
Thanks Valentin Despa for guiding me in the right direction :-).
Here the whole procedure (simplified - validations and exact steps omitted):
Define the form fields in the models/forms/site.xml as normal.
In views/site/tmpl/edit.php add self coded Javascript (based on jQuery) to deal with the fields which have content in multiple languages stored as JSON in database.
Clone the original form element and modify the needed attributes (id, name, ...) to display a special version just for the defined languages. As content - extract the JSON for the needed language from original field content and display.
Hide the original field with Javascript and append the customized versions to DOM.
Afterwards in tables/site.php I read the dynamically generated content withJInput and build together the original field by generating JSON and saving to database.
It's working like expected.

Looking for links for zend framework ajax table refresh

As you maybe aware from the following post I'm new to the Zend framework and web programming so any help is greatly appreciated.
What I want to do is have a page that my users can search for clients stored on the database have the results returned via a table. I know how to do this in a traditional form -> post -> results page manner but I would like to implement the following:
Have two or more Dojo autocomplete combo boxes that the user can enter search criteria into (I've found examples of this on the web and should be ok implementing this.)
Use the text entered into the query the clients table in the DB.
Return the results in a table on the same page without having to redirect, and if possible have the table update the results as the user types into the combo boxes.
for example if the user types "Fa" for example the table will have
"Farrell
"Fagan"
"Farrelly"
As the user continues to type eg "Far" the table will have
"Farrell"
"Farrelly"
As you may have already guessed I need help with parts two and three. I've tried searching using keywords refresh and autocomplete but I've been unable to find anything that comes close to what I need.
Can anyone please provide links to tutorials/examples of how to do this in the Zend Framework. I know code is a lot to ask for but if anyone is feeling generous go ahead.
Just in case it makes a difference I'm using Doctrine ORM to handle my models.
Thanks in advance for any replies.
Graham
The basic gist is this...
Using the AjaxContext helper, add an html context to your action.
Move your table markup into a .ajax.phtml file and replace it in your normal view with a render call
Example
<?php echo $this->render('controller-name/action-name.ajax.phtml') ?>
Add your JavaScript event handlers to the page. When requesting the AJAX content, add a format=html parameter to the request. This will trigger the AjaxContext helper, returning only your table markup which you can then inject into the page.
The best part about this approach is that it degrades gracefully. If JavaScript is disabled or not available, the page reverts to the old school form -> post -> results method.
Have a look at my AJAX pagination post here for some pointers - http://blog.philipbrown.id.au/2011/03/awesome-pagination-with-zf-paginator-ajaxcontext-and-the-html5-history-api/
This uses a page parameter in the same way you want to use your search criteria so it should do as a base reference.

Resources