Feature #37548
YAG as Header for Page and Sub page
| Status: | Needs Feedback | Start date: | 2012-05-28 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | Axel Spieth | % Done: | 0% |
|
| Category: | - | |||
| Target version: | YAG 2.2 | |||
| Votes: | 0 |
Description
Perhaps a simple question:
I need a slinding gallery for a page and all their subpages.
The ideer is to add a YAG gallery via ext template to the master page
so all subpages get the same sliding headers .
Is there a possibility to do this with YAG?
br Axel
History
Updated by Daniel Lienert about 1 year ago
- Status changed from New to Resolved
This could be done by the extbase default way .. have a look at this snippet:
Regards
Daniel
Updated by Axel Spieth about 1 year ago
- Status changed from Resolved to New
Thanks fpr the hint how to solve this.
Now my TS looks like this:
plugin.tx_yag.HeaderSlider {
albumHeaderSlider = USER
albumHeaderSlider {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = Yag
controller = Album
action = showSingle
switchableControllerActions {
Album {
1 = showSingle
}
}
settings =< plugin.tx_yag.settings
persistence =< plugin.tx_yag.persistence
view =< plugin.tx_yag.view
}
}
plugin.tx_yag.HeaderSlider.albumHeaderSlider.settings.theme = nivoSlider
page.10.marks.IMGHEADER < plugin.tx_yag.HeaderSlider.albumHeaderSlider
Opening the page the error : No Album selected appears
Changing the controller to ItemList and the action to list all images ever uploaded where shown.
I tried using the internalFilters of the theme -> no change
How can I select what to show in the inserted plugin?
Sorry about this question again. Perhaps its very easy to answer but
at the moment I can not find any suitable documentation about
inserting extbase plugins via TS and doing the necessary configurations lik in the
backend.
Br Axel
Updated by Michael Knoll about 1 year ago
Hi Axel,
thanks for asking - I just had to figure it out... here comes the solution:
plugin.tx_yag.HeaderSlider {
albumHeaderSlider = USER
albumHeaderSlider {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = Yag
controller = Album
action = showSingle
switchableControllerActions {
Album {
1 = showSingle
}
}
settings =< plugin.tx_yag.settings
#### Here comes the important line ####
settings.context.selectedAlbumUid = 139
persistence =< plugin.tx_yag.persistence
view =< plugin.tx_yag.view
}
}
Now you have to replace 139 with whatever album UID you want to show and you are done!
Happy TypoScripting!
Mimi
Updated by Michael Knoll about 1 year ago
- Status changed from New to Resolved
Updated by Axel Spieth about 1 year ago
Wow - Thanks for the solution.
A litle documentation of this feature would be useful.
:-) YAG is great
br Axel
Updated by Michael Knoll about 1 year ago
Here comes "a little documentation" of this feature...
http://mimi.kaktusteam.de/blog-posts/2012/05/inserting-yag-plugins-via-typoscript/
Happy you like our extension!
Mimi
Updated by Michael Knoll about 1 year ago
Oh - by the way - if you have finished on whatever you are working - could you please send me a URL or a screenshot so I could add it to my Blog as an example? Would be great, thanks!
Updated by Axel Spieth about 1 year ago
- File screen.jpg added
the goal was to create a slider with several images as a header for every page
without inserting a YAG plugin on every page.
The slider images should change on every main menu site and have to
be the same as on their main menu site on every sub menu site.
Additional to the sliding images there should be the possibility
to place logos and text into the slider.
The YAG-Theme is created in the root template:
#Definition des HeaderSliders
plugin.tx_yag.settings.themes {
HeaderSlider < plugin.tx_yag.settings.themes.nivoSlider
HeaderSlider {
title = Header Theme
description = This Theme is for the header slider on every page
itemList.showTitle = 0
nivoSliderSettings{
directionNav = false
controlNav = false
controlNavThumbs = false
}
item.showItemMeta = 0
resolutionConfigs {
medium >
medium = GIFBUILDER
medium {
XY = [10.w],[10.h]
format = jpg
quality = 90
width = 1100c
height = 165c
10 = IMAGE
10 {
file.maxW = 1100
file.maxH = 165
file.import.field = yagImage
}
// Load watermark image file
20 = IMAGE
20 {
file = fileadmin/yag/watermark/logo4.png
// Center the watermark image (for a watermark size of 100x100px): offset = [10.w]/2-50,[10.h]/2-50
offset = [10.w]-600,[10.h]-70
}
}
}
}
}
module.tx_yag.settings.themes.HeaderSlider < plugin.tx_yag.settings.themes.HeaderSlider
To realize the logo and the text inside the sliding images the watermark technology from
http://daniel.lienert.cc/blog/blog-post/2011/09/23/yag-bilder-mit-wasserzeichen-versehen/
is used.
The images for the header slider are placed into several albums of one gallery.
Each album contains the header images for one main menu site.
On every main menu site an ext template defines the plugin to be inserted and the
album to be shown:
plugin.tx_yag.HeaderSliderPlugin {
albumHeaderSlider = USER
albumHeaderSlider {
userFunc = tx_extbase_core_bootstrap->run
pluginName = Pi1
extensionName = Yag
controller = Album
action = showSingle
switchableControllerActions {
Album {
1 = showSingle
}
}
settings =< plugin.tx_yag.settings
persistence =< plugin.tx_yag.persistence
view =< plugin.tx_yag.view
settings.context.selectedAlbumUid = 3
}
}
plugin.tx_yag.HeaderSliderPlugin.albumHeaderSlider.settings.theme = HeaderSlider
The ###IMGHEADER### mark in the template has to be replaced with the plugin:
page.10.marks.IMGHEADER < plugin.tx_yag.HeaderSliderPlugin.albumHeaderSlider
E voila the result can be seen in the attached screenshot.
ToDo:
finding a way to make the selectedAlbumUid more dynamically.
The idea is to place the "insert plugin part" into the root template
and to get the needed albumUid dynamically (from database ?)
If I have time perhaps I try to develop an extension on base of yag for this purpose.
But at the moment the solution is oK for the project.
The whole project is in development at the moment and resides on a local server
in my office so a link don't make sense.
Br
Axel
Updated by Michael Knoll about 1 year ago
Hi Alex,
what you can do very easily (if you haven't yet) is to replace the "hard-coded" album uid with a TypoScript constant and set it on every page / main section, you want to change the album:
settings.context.selectedAlbumUid = {$plugin.tx_yag.HeaderSliderPlugin.albumHeaderSlider.settings.context.selectedAlbumUid}
Another possibility is to use a PHP function to set the UID. This should look somehow like this:
settings.context.selectedAlbumUid = USER
settings.context.selectedAlbumUid {
userFunc = your_fancy_album_uid_generator->your_fancy_method
}
Putting a nice random SQL snippet behind the function should do the job.
Thanks for your response, I will perhaps put some of the ideas on my blog to give an example!
Greez
Mimi
Updated by Axel Spieth 6 months ago
- Status changed from Resolved to New
- Target version changed from YAG 1.5.1 to YAG 2.2
After upgrading to the acutal version of YAG pt_extlist and pt_exbase
the plugin does not show images anymore.
I check the album and the albumID - every thing seems to be oK
I changed the theme from the self defined headerSlider to other sliders:
- nivoSlider: no imgages ar shown
- default / lightbox: only the album name is shown
Any idea whats happened
Br
Axel
Updated by Daniel Lienert 5 months ago
- Status changed from New to Needs Feedback
- Assignee set to Axel Spieth
Hey Axel,
Have you updated the database structure for YAG 2.x according to the manual?
Updated by Axel Spieth 5 months ago
I think I have done everthing according the manual.
Next thing I tried is to add the extension to a clear installation from the introduction package
to get more information abaout the problem.
The installation comes with:
typo3 4.7.7
php 5.3.5
The installation and configuration of yag went fine.
But when klicking on the upload images button of an album I get a HTTP:500 ERROR ??
BR
Axel
Updated by Daniel Lienert 5 months ago
Hey Axel,
in order to help you, i need a more detailed error message. Check the servers error log for the detailed error.
Updated by Axel Spieth 5 months ago
OK next test:
New typo3 instance on a STRATO hosted Server.
Typo3 4.7.1
PHP 5.3.8
YAG 2.2.1
YAG Themepack jQuery 1.0.0
pt_extbase 1.2.0
pt_extlist 1.1.0
On this server I con upload images without any problem.
I figured ou, the the difference between this
site and the site created with the intoduction package is:
the installation with the intruduction package as no access to the exif_read_data() of php
I will test if this causes the problem with the image upload.
Back to the primary problem showing my silder pictures in the header.
again no pictures are shown !!!
you can see the result at
On the page "Home" the ###IMGHEADER### marker is replaced with the slider but no pictures are shown.
The marker is shown on the "Test" site.
As requested I ha a look in the log - no errors displayed.
Any suggestions ?
If you want I can send you the password for the backend via Email.
Yust send me an Email (axel@aspieth.com)
BR
Axel
Updated by Axel Spieth 5 months ago
I made some further invetigations on the problem:
1. after deleting the content of the folder /typo3temp/yag/00 - no temp files are created in this folder ???
2. The TypoScript Object Browser shows error:
Line 3634: Object Name String, "TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface.className" contains invalid character "\". Must be alphanumeric or one of: "_-." Show details
Line 10503: Object Name String, "TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface.className" contains invalid character "\". Must be alphanumeric or one of: "_-." Show details
Line 12577: Object Name String, "TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface.className" contains invalid character "\". Must be alphanumeric or one of: "_-." Show details
Line 14651: Object Name String, "TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface.className" contains invalid character "\". Must be alphanumeric or one of: "_-." Show detail
I'm not shure if this may cause any problems.
BR
Axel