Social media links in TYPO3 using typoscript - typo3

I'm newbie to TypoScript. I actually don't know how to make link like this:
By googling, I got some idea on typoscript like this:
lib.social = COA
lib.social.special = language
lib.social.special.value = 0,1,2
lib.social.1 = GMENU
lib.social.1{
wrap = <ul> | </ul>
noBlur = 1
expAll = 1
NO = 1
NO {
ATagTitle.field = title // nav_title
stdWrap.htmlSpecialChars = 1
wrapItemAndSub = <li> | </li>
accessKey = 1
}
}
lib.social.1.NO{
XY = [5.w]+4, [5.h]+4
5 = IMAGE
5.file = {$global.imagePath}facebook.png || {$global.imagePath)twitter.png || {$global.imagePath)xing.png
5.offset = 2,2
}
I'm sure I got a problem with lib.social = language and I also try different things lik directory or browse but it still does not work and I may have some mistakes with the above script which I can't figure out.
In overall, I don't know how to make it work by linking to the external urls using typoscript.
Thanks

Most of social networks has their own embedding code so you don't need to create it manually, just can put into the marker the code...
lib.social = COA
lib.social.10 = TEXT
lib.social.10.value = <fb:like send="true" width="450" show_faces="true"></fb:like>
you can also use www.addthis.com to place many different social buttons
If you need to use custom graphics anyway, use common links, each with custom id attribute, then just use CSS to set it's display as block set the width,height, float (to make sure the each button is in the sam line, and finally background-image with your buttons. Use sprite technique for the image for best results (all buttons in one file, then set correct button for link with background-position

I see u just want to have some image menu.
Create a new page of type Menu Separator in your pagetree
Create a new page for every menu item and use type Link to External URL (don't forget to fillin the url in the page properties)
Upload your image inside the page properties under Resources -> media
Use the code below to show the menu on your front-end (replace special.value = 2000 with the page ID of your social page.
Code: http://shrib.com/gRrK9uGL
(sorry didnt get the code visible here)

Related

How to display latest or all posts (pages) of a parent page, in a single page in TYPO3 CMS

I have a TYPO3 TypoScript html template and want to show in a single page (called: "competitions"), a list of all competitions with their image and title and this should be links for each of them ('competition'). I have thought to make a page ('competitions') and subpages ('single cmpetition'). I'm not using Fluid actually. How can i get and display those in main page? Or is another way to achieve this ?
depending on your data structure (is the relevant info you want to show stored in the pages record or do you want access tt_content records inside that pages) it is more or less easy.
you always can access the informations with typoscript, but those constructs may get complicated. that means: developing the TS may take some time and the following rendering might also get complex and might take some time.
the easiest way: all information in pages records:
temp.competitions = CONTENT
temp.competitions {
table = pages
select {
pidInList = this
orderBy = sorting
}
renderObj = COA
renderObj {
wrap = <div class="teaser">|</div>
10 = TEXT
10.field = title
10.wrap = <h3>|</h3>
20 = TEXT
20.field = abstract
20.wrap = <div class="abstract">|</div>
30 = IMAGE
:
}
}

Breadcrumb menu not working properly in Typo3 7.6.6

I already searched the whole internet for a solution but didn't find the right answer, so here is my question:
I have been trying to introduce a breadcrumb menu inside my website. I've done this by writing the following HMENU:
lib.breadcrumb=COA
lib.breadcrumb {
10 = HMENU
10 {
special = rootline
special.range = 1|-1
includeNotInMenu = 1
1 = TMENU
1 {
# no unneccessary scripting.
1.noBlur = 1
# Current item should be unlinked
1.CUR = 1
1.target = _self
1.wrap = <div class="breadcrumb"> | </div>
1.NO {
stdWrap.field = title
ATagTitle.field = nav_title // title
linkWrap = ||*| » |*|
}
# Current menu item is unlinked
1.CUR {
stdWrap.field = title
linkWrap = ||*| » |*|
doNotLinkIt = 1
}
}
}
}
The menu is showing on the website so the wiring is working fine. But the problem is, despite all sites have the common root site Home in backend hierarchie, the root isn't shown at all sites. Here is an concrete example of two different sites with the same site hierarchie tree returning different breadcrumbs:
Backend-Site-Tree:
Home----Referenzen-----Vertriebsplattform
\---Kompetenzen----Schnittstellentechnik
edit:
Breadcrumbs:
I searched for differences in site configuration, but negative report. I also reset caches multiple times.
Does anybode have a similar problem or have an idea what could be wrong?
Thanks in advance,
Thomas
take this:
special = rootline
special.range = 1
After many hours of research I found the reason why the breadcrumb didn't appear properly.
All the sites on the second level of the hierarchie use the same template (another one than the home site). But those of them which didn't show Home as part of their breadcrumb also mistakenly included the template of the home site as basic template. This has to be a remnant of earlier stages of development :(
I don't know exactly why the breadcrumb menu was affected by this but the problem disappeared after fixing this dependency.
Anyways thanks for all your answers and suggestions.

get page title in styles.content.get

I am getting the content of a certain page and output it on another page in typoscript. what i would like to do is to get the page title and output it above the content.
This is my code for getting the page content:
lib.Section1 = CONTENT
lib.Section1 < styles.content.get
lib.Section1 {
select.languageField=sys_language_uid
select.where = colPos=0
select.pidInList = 19
}
For printing the page title i'm thinking of something like this:
lib.Section1.wrap = <div class="title">{page_title}</div>|
but i haven't been able to find the right method. Googling didn't help as the most methods i found there involved an hmenu or tmenu, which is not very practical in my case because i only need the content of a particular page. Maybe there is someone who can help.
You should indeed use a HMENU, since other methods (using CONTENT or similar) will run into problems with translations and selecting the right page.
Here is a simple HMENU:
lib.pageTitle = HMENU
lib.pageTitle {
special = list
special.value = 19
1 = TMENU
1 {
NO = 1
NO {
doNotLinkIt = 1
wrapItemAndSub = <h1>|</h1>
}
}
}
Have you tried this?
lib.Section1.dataWrap = <div class="title">{page:title}</div>|
First of all i think you need to use dataWrap to insert global Values (variables). And after that you can access some global data like page title i think.

Add Data attributes in typoscript to a link

i have a question regarding typoscript. I am new to typo3 and i am just looking into things.
I know i can do something like this in typoscript:
stdWrap.htmlSpecialChars = 1
ATagTitle.field = title
is it possible to put in a data-attribute to the a tag as well? Something like this:
ATagData.field = data-toggle="hover"
If you have a TEXT object, then you should take a look at »typolink« and »ATagParams« (eg: »typolink.ATagParams = class="foo"«)
Since you posted »ATagTitle« I know that you work with a navigation object. In there you may use »ATagParams« as well:
ATagParams = data-toggle="hover"
See reference for TypoScript TMENU items: http://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Tmenuitem/Index.html?highlight=atagparams

Typo3: How to use title of header_link field as link text?

using Typo3 6.1, I'd like to be able to add a link with an editable caption to the end of each content element, linking to some related page. My approach was to (mis)use the header_link field for that. I removed the typolink from the headline and added the link after the content.
# something like:
20.text.20.append {
if.isTrue.field = header_link
value = more...
typolink.parameter.field = header_link
wrap = <div class="button">|</div>
}
To be able to use different captions for each link (instead of "more..."), I hoped to use the title property of the typolink since it can easily be set in the backend. Is this possible? Or is there a more reasonable way to achieve this?
The most straightforward way would probably be adding a new link field and a title field for that link by building a custom extension just for that purpose (adding the fields to BE and Database). Then editors can fill in these fields in the same tab and you can access them with typoscript.
You can use COA with new Object
100.value = more
100.wrap = <div class="button">|</div>
100.typolink ...
or use wrapper existing element
stdWrap.typolink {
wrap = <div class="linkwrap">|</div>
parameter.insertData = 1
parameter = {field:header_link}
ATagParams = class="headerLink"
ATagBeforeWrap = 1
}