Insert media image in detail view - typo3

I'm using TYPO3 9.5.3 and the sf_books extension to manage books.
I inserted book on BE with image cover for the book item.
I get this error on the singleView (detail) :
The argument "image" was registered with type "object", but is of type "string" in view helper "TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper".
When I check the template file I find this code supposed displays an image :
<f:image image="{book.cover}" maxWidth="200" alt="{book.title}"/>
How can I change this code the solve the error and display the cover book ?

if you have a look here https://github.com/evoWeb/sf_books/blob/develop/Resources/Private/Templates/Book/Show.html you can see, that the problem should be fixed. The {book.cover} gets iterated and used as {cover} in the
If you experience futher errors, feel free to hand in issues in the tracker https://github.com/evoWeb/sf_books/issues and they will be covered.

Related

Templavoila - Extra space in content when "Typoscript Only" or "Object Path"

This has been bothering me a little for a while and I couldn't find any other mention of that problem anywhere. It is not really important, but maybe there's a simple solution that I'm missing.
When creating a FCE, some Elements are Typoscript only or Typoscript Object Path.
When I set those, I get blank extra space in the content (In picture, see between Content and Description). This is an empty <div class="form-section">, just like the other fields but empty.
Is there a way to prevent Templavoilà Plus from displaying a field if no content is required from the redactor, meaning if they are an Typoscript Object Path for exemple?
please create an issue report about this on https://github.com/pluspol-interactive/templavoilaplus/issues and post an example DataStructure for this.
Thanks

Attempt to insert record on page ... where this table, fe_users/fe_groups, is not allowed

I looked at this Similar Question on here but I didn't understand half of what everyone is saying there as I'm not very familiar with TypoScript...
Let me start from my point of view: I got a backend tree in TYPO3 6.2 that looks like this:
Data is of type "Folder" where I want to store my records.
Userroles, Admins and Lawyer are of Type "Standard" while the last two contain the Plugin "Website Users".
Now I want to add a new fe_usergroup to page Userroles:
I get following error:
It's the same when I try inserting a new fe_user in Admins:
So in the other answers from mentioned question they're talking about Page-TS-Config - I looked at my Userroles Page and saw this:
and I went to the Template Analyzer and searched for allowedNewTables and deniedNewTables but no results. And to the comment: section ctrl which value has rootLevel - but those TCAs are from Extbase right? So why would they be wrong...
I must have done something wrong but I have no idea what it could be.
It worked before I think...although I don't know about the usergroups, didn't try to add a new one recently.
I placed
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_myext_download');
into the ext_tables.php of myext to allow this kind of records.
Maybe that helps.
Add in Your ext_tables.php in Your Extension following code:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_your_extension_table_name');
In TYPO3, you have to define, which tables are allowed on standard pages. There is a method in the ExtensionManagementUtility, that does extacly that:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_yourtable');
If you have a look at the source, you'll see, that this method ist just one line of code that concatenates table names into the global configuration array, specifically at
$GLOBALS['PAGES_TYPES']['default']['allowedTables']
Its possible that something in your TYPO3 installation messes with this line.
Check the value of this configuration value in either the Install Tool or the Confuguration tab in the backend. If this line contains anything other than comma seperated table names, something is wrong. TYPO3 base table names like pages,tt_content,fe_users,fe_groups and so on should also be listed there by default.
Is the page that you are trying to add usergroups to of type "page" or "directory" (see "General"-tab). Probably it must be of kind "directory" or "folder"

I search a tutorial on how play and customize with collection form

I need to create some forms non-linked to entities.
I pretty understood how create my builders, but when I try to use them, I am pretty confuse, and I don't really find examples in the online doc of Symfony 2.0
To go into the details: I create a "Multiple choice question" form. So I created:
a "class ResponseType extends AbstractType"
a "class MCQType extends AbstractType", which uses my class ResponseType
a file "forms.html.twig", which includes templates for my "responsetype_widget" and for my "mcqtype_widget"
My aim is to be able to customize the labels and play with them in this template (like add div with uniqueID, etc), specially the itemization when I add a new item: I would know how to change the "0", "1", "2", etc in "Bad answer 1", "Bad answer 2", etc.
Currently, I do it with JQuery, in the client-side. But when I submit my form, and an error appears, my created items appear with the "0", "1" ; generated by the server-side.
Here are screenshot to have a better view of the situation:
Modified by JQuery (sorry not enought reputation to post images)
Generated by Symfony 2
I really would customize these labels on the server-side, or in my "class MCQType extends AbstractType", or from the mcqtype_widget in forms.html.twig
I tried a lot of stuff that I found in the doc, but nothing works and I feel desesperate to mofify that from the JS instead of the server-side.
Is somebody have a good example?
Thank you by advance. And if any good tutorial is realeased about manipulate collections, I would really help me!
What you need to do for customizing those labels is to redefine the template block to include your modification.
To do so, you'll need this part of the documentation :
http://symfony.com/doc/2.0/cookbook/form/form_customization.html
I would also advise you to play with that in order to get familiar with the form collection :
http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap/forms/collections
Don't hesitate to go deep inside to see how they are doing.
PS: if you need to hide those labels, you need to pass 'show_legend' => false, inside the field options

How to make multistep forms with drupal using various node types

I'm creating a very basic classifieds website. In this website i'll have various content-types; such as :
Car (which has the cck fields : year, kilometers, color
House (which has the cck fields : number of floors, garden (yes/no)
So each 'element' is a content-type.
I'm listing all the content-types in a view that I display to the user aand then clicking on a link goes to 'create content type of type (clicked type)'.
It's working pretty well; but i can't get rid of the 'create new car' at the top of the create page (which reflects the 'drupalish' behaviour).
I'd like to have it in a more conveniant way such as a three step form like :
Choose category
Choose your options
Register to post your new classified
I've seen the ctools; which provide 'almost' the multistep behaviour; however i can't imagine having all my dozen content-types being 'hardcoded' in a single module.
I wonder if anyone has achieved this kind of setup or if there's a kind of module that can do the trick. I'd like to keep a content type for each type of classified (the webmaster is now used to the interface).
Any help, starting points would be appreciated.
For the first step we had to solve a simular problem. To do so we created what was basicly an override of the /node/add page (the one that lists all the content types), which you've done. To change the title the simplest is to create a yourtheme_preprocess_page() function that changes the title when the url is /node/add or node/*/edit
However: I would strongly suggest switching to a system that uses 1 content type for all listings. We created a very simular site, and after working with different content types it because clear that having 1 content type with fields that were displayed conditionally was a much more sane solution. Using categories for the different product types, and then using the Conditional Fields module to hide and show the correct fields worked much better.
http://drupal.org/project/conditional_fields
Here is and example snippet for setting the title in a page preprocess function:
Setting the title on the node/add page:
if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == '') {
$vars['title'] = 'Choose an Industry';
$vars['head_title'] = $vars['title'] . " | " . variable_get('site_name', "Industry Trader");
}

Only the first letter of a product description appears in zen cart

I'm working on this zen cart site. A Love Supreme Shop
In new and featured listings only the first letter of the product description appears whether I use a custom template or the default. I'm using 1.3.9 but the data has come from a 1.3.0 site.
When product descriptions are shown on all products they show up fine.
Is the description being put into an array incorrectly and only the first element of the array being displayed?
Go to admin->configuration->new listing, and look at the value of Display Product Description. I wonder if yours is 0. It should be 120 or 150. If you don't see this setting, your database is missing values.
Failing that look at the file
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php
and see how description is being handled.
Thanks Scott that helped me get to the root of the problem :
On my admin->configuration->new listing->Display Product Description page there is no textbox to change the number of characters displayed.
There is only a question :
Do you want to display the Product Description - First 150 characters?
Followed by the options 0 = off and 1 = on
I checked another zen cart running on another server and it has the textbox to change the number of characters.
I followed your instructions to look at :
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php
I edited the code that displays the product description replacing the value PRODUCT_NEW_LIST_DESCRIPTION with 150.
This worked.
However the underlying problem is solved here :
Solution on Zen Cart Forum
SELECT *
FROM configuration
WHERE configuration_title = 'display product description';
This returns 4 records
Changing configuration_value from 1 to 150
Changing configuration_description from :
Do you want to display the Product Description - First 150
characters?
to :
Do you want to display the Product Description?0= OFF150= Suggested Length, or enter the maximum number of characters to display
and changing the set_function from :
zen_cfg_select_option(array('0', '1'),
to :
NULL
Thanks for the assistance #Scott Wilson.
Still don't know the route cause of the problem. Probably not migrating the database properly.