Related
I am pretty new to typo3. The Website is all set up now i want to use realurl to make some human readable URLS.
Out of the boy it works pretty well. But not for my news sites.
http://myDomain/news-events/news/Name-of-the-Article/?tx_news_pi1%5Bday%5D=19&tx_news_pi1%5Bmonth%5D=7&tx_news_pi1%5Byear%5D=2017&cHash=6af067caeb037b4de744f6b9e07b73e8
Please help me to get rid of the last Parameters.
to get something like:
http://myDomain/news-events/news/Name-of-the-Article/
Here is my realurl_conf
[ See Update]
Thank you all for your time =)
Update:
So i worked my way through the manual.
I copied from them and inserted my IDs and Stuff
this is my new Configuration [ Deleted the first one ]
<?php
$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';
// Adjust to your needs
$domain = 'http://mydomain.de';
$rootPageUid = 1;
#$rssFeedPageType = 9818; // pageType of your RSS feed page
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain] = array(
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '3',
'rootpage_id' => $rootPageUid,
'firstHitPathCache' => 1
),
'init' => array(
'enableCHashCache' => TRUE,
'respectSimulateStaticURLs' => 0,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => TRUE,
'enableUrlDecodeCache' => TRUE,
'enableUrlEncodeCache' => TRUE,
'emptyUrlReturnValue' => '/',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
# 'feed.rss' => array(
# 'keyValues' => array(
# 'type' => $rssFeedPageType,
# )
# )
)
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
# 'en' => '1',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => "CONCAT(uid, '-', IF(path_segment!='',path_segment,title))",
/** OR ***************/
'alias_field' => 'IF(path_segment!="",path_segment,title)',
/** OR ***************/
'alias_field' => "CONCAT(uid, '-', title)",
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1, # 1?
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'expireDays' => 180,
),
#Depends ?
array(
'GETvar' => 'tx_news_pi1[day]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[month]',
'noMatch' => 'bypass',
),
array(
'GETvar' => 'tx_news_pi1[year]',
'noMatch' => 'bypass',
),
),
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
#TODO: ID-News Seite Finden
#'145' => 'newsDetailConfiguration',
#'147' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
#'134' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
'148' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
'149' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
#'71' => 'newsTagConfiguration',
#'72' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
),
),
)
);
But still there are the
tx_news_pi1[day], tx_news_pi1[month], tx_news_pi1[year] and cHash
Parameters in the URL.
Please Help me to get rid of them.
thats my configuration:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'_DEFAULT' => array (
'init' => array (
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array (
'rootpage_id' => '2',
),
'fileName' => array (
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array (
'print' => array (
'keyValues' => array (
'type' => 98,
),
),
),
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'en' => '1',
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
),
'fixedPostVars' => array(
// config for single/detail news:
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'concat(uid,\'_\',title)',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
// config for category selection:
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
// configuration for tag selection:
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
// add your page uids where you have detail view of news:
'70' => 'newsDetailConfiguration',
//'701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
/connect page uid for further views: tag-selection, category-selection"
'71' => 'newsTagConfiguration',
'72' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[#widget_0][currentPage]',
),
),
),
),
),
);
look for the right insertion in the array. For that have a clean indention!
The already mentioned link is quite useful and contains detailed info:
https://docs.typo3.org/typo3cms/extensions/news/AdministratorManual/BestPractice/Realurl/Index.html
There are 3 ways explained there:
a basic one which still shows action and controller name as an URL path segment
an advanced example (the one Bernd Wilke is using in his sample as well)
a TypoScript solution to avoid controller and action name in URL
Option 2 can only be used if you show your detail news on a dedicated pages (separate page for list and detail view) as you configure a preset for a controller and action name for a special page (uid) - your news detail view.
Option 3 basically does the same as Option 2, but on a TypoScript level and it can be used in a case where list and detail view is on one single page.
Both options can / should be used in combination with the setting skipControllerAndAction = 1.
In case you want to use the basic setup. The postVarSets is on the same level as fixedPortsVars or preVars
Additional hint:
Do you use any other language than DE or EN as your default language? If so your default language has sys language uid of 0 and thus all good.
The default language usually has sys language uid of 0. If you do not need a default language path segment, you leave it out in our real url config thus it gets bypassed.
More info on language setup: https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages
RealUrl Doc:
https://github.com/dmitryd/typo3-realurl/wiki
I am trying to create relationships through module loader in SugarCRM. But the problem is my package is stopped installing after 55%. When I am viewing display log the error is:-
Failed to copy
cache/upgrades/temp/SYWr9G/custom/metadata/accounts_contacts_1MetaData.php
custom/metadata/accounts_contacts_1MetaData.php
I tried to change permissions also but at some point they through internal server error 500. Following are the code which I am using.
1.In manifest.php file :
$installdefs = array(
'id' => 'package_20170804',
'copy' => array(
0 => array(
'from' => '<basepath>/accounts_contacts_1MetaData.php',
'to' => 'custom/metadata/accounts_contacts_1MetaData.php',
),
1 => array(
'from' => '<basepath>/accounts_contacts_1.php',
'to' => 'custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php',
),
),
'relationships'=>array (
array (
'module'=> 'Accounts',
'meta_data'=>'<basepath>/custom/metadata/accounts_contacts_1MetaData.php',
'module_vardefs'=>'<basepath>/custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php'
)
),
);
2. In accounts_contacts_1MetaData.php file :
<?php
$dictionary["accounts_contacts_1"] = array (
'true_relationship_type' => 'one-to-many',
'from_studio' => true,
'relationships' =>
array (
'accounts_contacts_1' =>
array (
'lhs_module' => 'Accounts',
'lhs_table' => 'accounts',
'lhs_key' => 'id',
'rhs_module' => 'Contacts',
'rhs_table' => 'contacts',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'accounts_contacts_1_c',
'join_key_lhs' => 'accounts_contacts_1accounts_ida',
'join_key_rhs' => 'accounts_contacts_1contacts_idb',
),
),
'table' => 'accounts_contacts_1_c',
'fields' =>
array (
0 =>
array (
'name' => 'id',
'type' => 'varchar',
'len' => 36,
),
1 =>
array (
'name' => 'date_modified',
'type' => 'datetime',
),
2 =>
array (
'name' => 'deleted',
'type' => 'bool',
'len' => '1',
'default' => '0',
'required' => true,
),
3 =>
array (
'name' => 'accounts_contacts_1accounts_ida',
'type' => 'varchar',
'len' => 36,
),
4 =>
array (
'name' => 'accounts_contacts_1contacts_idb',
'type' => 'varchar',
'len' => 36,
),
),
'indices' =>
array (
0 =>
array (
'name' => 'accounts_contacts_1spk',
'type' => 'primary',
'fields' =>
array (
0 => 'id',
),
),
1 =>
array (
'name' => 'accounts_contacts_1_ida1',
'type' => 'index',
'fields' =>
array (
0 => 'accounts_contacts_1accounts_ida',
),
),
2 =>
array (
'name' => 'accounts_contacts_1_alt',
'type' => 'alternate_key',
'fields' =>
array (
0 => 'accounts_contacts_1contacts_idb',
),
),
),
);
3. In accounts_contacts_1.php file:
<?php
include('custom/metadata/accounts_contacts_1MetaData.php');
?>
I just wanted to create a field in relationship that's all . Maybe I am missing somewhere in manifest file or i needed to include some additional file.
I solved it. You can follow following steps to create relationships in SugarCRM through module loader.
Step 1:- Give permission to your sugar directory according to following
For Linux: http://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Linux/
For Windows:
http://support.sugarcrm.com/Knowledge_Base/Platform_Management/Required_File_System_Permissions_on_Windows_With_IIS/
Step 2:- In manifest.php
<?php
$manifest = array(
'acceptable_sugar_flavors' => array('CE','PRO','CORP','ENT','ULT'),
'acceptable_sugar_versions' => array(
'exact_matches' => array(),
'regex_matches' => array('(.*?)\\.(.*?)\\.(.*?)$'),
),
'author' => 'Ravi Ranjan',
'description' => 'Relationship',
'icon' => '',
'is_uninstallable' => true,
'name' => 'custom relation',
'published_date' => '2017-08-10 2017 11:45:04',
'type' => 'module',
'version' => '20170810',
);
$installdefs = array(
'id' => 'package_20170810',
'copy' => array(
0 => array(
'from' => '<basepath>/accounts_contacts_1MetaData.php',
'to' => 'custom/metadata/accounts_contacts_1MetaData.php',
),
1 => array(
'from' => '<basepath>/accounts_contacts_1.php',
'to' => 'custom/Extension/application/Ext/TableDictionary/accounts_contacts_1.php',
),
),
);
?>
Step 3:- The contents of both file accounts_contacts_1MetaData.php and accounts_contacts_1.php will be same as you can see in question.
Step 4:- Compress all three files and upload through module loader, after installation quick repair and rebuild.
Go in Studio > Accounts > Relationships You will see a new field there name accounts_contacts_1 That's what I wanted to create.
First of all excuse my bad english.
I got a problem with my select-field in the BE. I would like to prefill (preselect) all of the available items.
Code in ext_tables.php:
'teilnehmer' => array(
'exclude' => 0,
'label' => 'LLL:EXT:kiwanisext/Resources/Private/Language/locallang_db.xlf:tx_kiwanisext_domain_model_veranstaltung.teilnehmer',
'config' => array(
'type' => 'select',
'foreign_table' => 'fe_users',
'MM' => 'tx_kiwanisext_veranstaltung_user_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'wizards' => array(
'_PADDING' => 1,
'_VERTICAL' => 1,
'edit' => array(
'type' => 'popup',
'title' => 'Edit',
'script' => 'wizard_edit.php',
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
),
'add' => Array(
'type' => 'script',
'title' => 'Create new',
'icon' => 'add.gif',
'params' => array(
'table' => 'fe_users',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
),
),
),
),
I found nothing helpful in the documentation.
Any hint, tip or help will be much appreciated!
Its not possible to do that with plain TCA config, afaik. You can however define a default value wich will be selected (if none is defines, 1st item will be selected).
'default' => 'myValue'
But to preselect multiple values at once, you have to use JavaScript I guess.
This code worked for me in typo3 6.2. I have a selectbox filled with database records.
I want the records with ID's 1 ans 2 to be preselected in the selectbox:
'thematique' => array(
'exclude' => 0,
'label' => 'LLL:EXT:dk_actus/locallang_db.xml:tx_dkactus_thematique',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_dkactus_thematique',
'foreign_table_where' => 'ORDER BY tx_dkactus_thematique.uid',
'size' => 10,
'minitems' => 0,
'maxitems' => 99,
'default' => '1,2',
),
),
*I solved it myself... like 10 minutes later. *
$varbgimg = $row->_field_data['nid']['entity']->field_slideimage['und'][0]['uri'];
Is what I used...
Hope someone can help me. How can I access 'uri' => 'public://veglo8.jpg'?
This is from Drupal and the Views module. If someone could maybe even help me with my ultimate goal, I would appreciate that...
I have a field in Views called slideimage. I want to add a style="background-image:url(image field URL);" to my div. Tried to rewrite the output but it strips the style...
Thanks in advance.
stdClass::__set_state(array(
'nid' => '20',
'node_title' => 'Test 1',
'field_data_field_slideimage_node_entity_type' => 'node',
'field_data_body_node_entity_type' => 'node',
'_field_data' =>
array (
'nid' =>
array (
'entity_type' => 'node',
'entity' =>
stdClass::__set_state(array(
'vid' => '20',
'uid' => '1',
'title' => 'Test 1',
'log' => '',
'status' => '1',
'comment' => '1',
'promote' => '0',
'sticky' => '0',
'nid' => '20',
'type' => 'test',
'language' => 'und',
'created' => '1358336066',
'changed' => '1358337923',
'tnid' => '0',
'translate' => '0',
'revision_timestamp' => '1358337923',
'revision_uid' => '1',
'body' =>
array (
'und' =>
array (
0 =>
array (
'value' => 'Body text here',
'summary' => '',
'format' => 'filtered_html',
'safe_value' => '
Body text here',
'safe_summary' => '',
),
),
),
'field_slideimage' =>
array (
'und' =>
array (
0 =>
array (
'fid' => '8',
'alt' => '',
'title' => '',
'width' => '624',
'height' => '390',
'uid' => '1',
'filename' => 'veglo8.jpg',
'uri' => 'public://veglo8.jpg',
'filemime' => 'image/jpeg',
'filesize' => '27393',
'status' => '1',
'timestamp' => '1358336725',
'rdf_mapping' =>
You can use file_create_url to convert public://... to real world URLs.
$real_url = file_create_url($img_src);
I've used the pathinfo() function for this in the past.
http://php.net/manual/en/function.pathinfo.php
You can apply styles programmatically with this by replacing user-picture[0]['uri'] with your image url. I think you can even place the whole public:// url in there and it will work just fine as well.
THUMBNAIL_STYLE = 'thumbnail';
// now get the full image url from the uri and the style
$default_thumbnail = image_style_url($THUMBNAIL_STYLE, $user->picture[0]['uri']);
http://drupal.org/node/1425836
I am trying to setup realurl to work with my extension.
I think I am doing something wrong because I can't get rid of the cHash
parameter. My realurl config is
REALURL START
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'fileName' => array(),
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect',
'adminJumpToBackend' => true,
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'emptyUrlReturnValue' => '/',
),
'_DEFAULT' => array(
'redirects' => array(),
'preVars' => array(),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'expireDays' => 30,
'rootpage_id' => '1',
),
'postVarSets' => array(
'_DEFAULT' => array(
'kategori' => array(
array(
'GETvar' => 'tx_projgallery_pi1[cat]',
'lookUpTable' => array(
'table' => 'tx_projgallery_categories',
'id_field' => 'uid',
'alias_field' => 'category',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => '1',
'useUniqueCache_conf' => array(
'strtolower' => '1',
'spaceCharacter' => '-'
)
),
),
),
'album' => array(
array(
'GETvar' => 'tx_projgallery_pi1[album]',
'lookUpTable' => array(
'table' => 'tx_projgallery_gallery',
'id_field' => 'uid',
'alias_field' => 'navi_title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => '1',
'useUniqueCache_conf' => array(
'strtolower' => '1',
'spaceCharacter' => '-'
)
),
),
),
'billede' => array(
array(
'GETvar' => 'tx_projgallery_pi1[show]',
'lookUpTable' => array(
'table' => 'tx_projgallery_photos',
'id_field' => 'uid',
'alias_field' => 'uid',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => '1',
'useUniqueCache_conf' => array(
'strtolower' => '1',
'spaceCharacter' => '-'
)
),
),
),
),
),
),
);
REAL URL END
I have googled it like a maniac but did find any helpful info.
Can someone see what I am doing wrong?
Check your extension configuration. Are all tables and fields created? If not try to create the tables and fields via phpMyAdmin on your own.
Check if table tx_realurl_chashcache is there, it should not be empty.
Activate enableChashUrlDebug in realurl extension configuration.
Activate enableDevLog in realurl extension configuration
Install extension devlog
So, check the log and the cache-tables for errors.
Deactivate realurl and check the links. Perhaps you find some issues then.