Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 10 replies, 2 voices, and was last updated 5 years, 7 months ago by
Steven Zahm.
-
AuthorPosts
-
08/02/2017 at 8:13 am #431118
Patrick
ParticipantHi Steve,
I created my own custom template called “mycard” according to reply #363303 in https://connections-pro.com/support/topic/modification-of-template-2/I activated the plugin and it worked, but when trying to change colors via css or customize it (e.g. unckeck show email addresses) it doesn’t work as expected.
1.I created mycard.css, but these css style definitions will be overwritten by inline style definitions.
2.When using the customizer it has no effect. But when customizing the default “card” template, changes has effect in “card” and “mycard”
I hope you can tell me what I’m doing wrong.
Regards
Patrick08/02/2017 at 11:10 am #431141Steven Zahm
Keymaster@ Patrick
RE: I created mycard.css, but these css style definitions will be overwritten by inline style definitions.
Remove the inline styles from you custom template or use the
!important
modifier in the CSS.RE: When using the customizer it has no effect. But when customizing the default “card” template, changes has effect in “card” and “mycard”
Best guess, you need to change the
const SLUG = 'card';
line incard-default.php
to be unique to you custom template. A point not covered in the forum post you found because, I think at the time, the Customizer feature had not yet existed. Or I forgot to mention it. Creating your own custom templates is quite a bit more difficult when compared to using template override files or moving a core template to the plugins folder.Hope this helps, let me know.
08/02/2017 at 2:57 pm #431157Patrick
ParticipantHi Steve,
for my css problem I found a solution. I will use custom classes (e.g. “cn-myentry” to not interfere with the default card template.But using the customizer to modify default card template also changes the entries in my custom “mycard” template. I use the correct unique slug “mycard” and I also changed following in the default-card.php from:
require_once CN_PATH . 'templates/card/class.customizer.php';
to
require_once CN_PATH . '../../plugins/connections-mycard/class.customizer.php';
I don’t know If this is correct, but anyway it doesn’t work.
08/03/2017 at 2:24 pm #431251Steven Zahm
Keymaster@ Patrick
RE: using the customizer to modify default card template also changes the entries in my custom “mycard” template.
Odd, the only reason I can think this be the case is the slug or you are actually using the card template on the page instead of your mycard template. I only mention it because others have made a similar mistake. Is you mycard template the activated template? What is the exact shortcode you are using on the page set as the directory homepage? Have you enabled the Single Entry Template option? All of which can affect the actual template being used.
RE: I don’t know If this is correct, but anyway it doesn’t work.
No, I believe this is what you want:
require_once plugin_dir_path( __FILE__ ) . 'class.customizer.php';
The next update… I’ve made this change to the included Card and Profile template so it will not be an issue for other in the future.
08/04/2017 at 2:44 am #431302Patrick
ParticipantHi Steve,
I doublechecked the slug and its correct. The activated template is “mycard” and the shortcode on the directory homepage is [connections].
But it still doesn’t work.
I changed the shortcut to [connections template="mycard"] now I see the customizer is opening the directory listing with this template, but doing any change (e.g. add or remove show address) still has no effect on the output.
Whereas customizing the “card” template also changes the visibility of entries in the output of “mycard” template.Regards
Patrick08/04/2017 at 11:09 am #431360Steven Zahm
Keymaster@ Patrick
I just went thru the process myself, but used the core Profile template instead of Card (I already had a plugin duplicated of Card):
- Move the
profile
folder from../connections/templates/
to../wp-content/plugins/
- Change the folder name from
profile
toconnections-profile
. (Not necessary) - Open the
profile.php
file and renamed all instances of theCN_Profile_Template
class tomyCN_Profile_Template
. - Change the slug from
profile
tomyprofile
. - Activated the template on the Plugins admin page.
- Navigated to the Connections Template page and tested the Customizer. It worked as expected.
- Because I moved the
profile
folder originally, the original Profile was no longer running at the same time so I copied a duplicate of the original back to thetemplates
folder so both Profile templates exists. - I tested Customizer on both instances of Profile and they functioned independently of each other as they should.
So, I guess my advice would be to take a step back. Archive your duplicate and make sure the original Card template is in fact original with no changes (that’s important) and that is in in the
../connections/templates/
folder.Then, follow my steps above which are basically the same as the tutorial. I need to add the instruction to change the slug.
The only other thing you’ll have to do which I did not is change the Customizer line from
require_once CN_PATH . 'templates/card/class.customizer.php';
torequire_once plugin_dir_path( FILE ) . 'class.customizer.php';
The next update to Connections will include that change so it will no longer be necessary.Hope this helps, let me know how it goes.
08/04/2017 at 5:38 pm #431451Patrick
ParticipantHi Steve,
I followed your instructions on a brand new wordpress instance with no plugins except connections.I moved (not copied) the card folder and changed the
require_once...
line and activated my1card (this is a temporary name fore testing).
When starting the customizer I got following error:
Warning: require_once(./class.customizer.php): failed to open stream: No such file or directory in /homepages/34/d560985172/htdocs/clickandbuilds/test/wp-content/plugins/conn1_card/card-default.php on line 325
Fatal error: require_once(): Failed opening required ‘./class.customizer.php’ (include_path=’.:/usr/lib/php7.0′) in /homepages/34/d560985172/htdocs/clickandbuilds/test/wp-content/plugins/conn1_card/card-default.php on line 325
When checking the directoty, the file is present:
(uiserver):u79741875:~/clickandbuilds/test/wp-content/plugins/conn1_card$ ls -l total 60 -rw----r-- 1 u79741875 ftpusers 8908 Aug 4 23:27 card-default.php -rw----r-- 1 u79741875 ftpusers 3687 Aug 4 23:25 card-single.php -rw----r-- 1 u79741875 ftpusers 4129 Aug 4 23:25 card.php -rw----r-- 1 u79741875 ftpusers 2952 Aug 4 23:25 class.customizer.php -rw----r-- 1 u79741875 ftpusers 30278 Aug 4 23:25 thumbnail.png (uiserver):u79741875:~/clickandbuilds/test/wp-content/plugins/conn1_card$
Regards
Patrick08/07/2017 at 11:30 am #431596Steven Zahm
Keymaster@ Patrick
The error message might not be showing the complete path but if it is, the path that is being generated by WP is
./class.customizer.php
(according to the error message. Technically this is correct, but I would expect the full absolute path rather the the relative path.Add the following line above the require_once line. Save and upload the file and then click the Customize button.
var_dump( plugin_dir_path( FILE ) . 'class.customizer.php' );
What is the message it outputs? It should be the full absolute path to the customizer file.
If it is the absolute path then there is something with the permissions of the file which is not permitting it to be read. There is nothing I can really do about that. If that is the case and you are not able to resolve the permissions issue the just add
//
at the beginning of the reuire_once line or delete it. It is not necessary for the template to function as it simply adds a few more customize options.Hope this helps!
08/11/2017 at 2:39 am #431984Patrick
ParticipantHi Steve,
I added the var_dump line and got following output showing the relative path:string(22) “./class.customizer.php”
Warning: require_once(./class.customizer.php): failed to open stream: No such file or directory in /homepages/34/d560985172/htdocs/clickandbuilds/test/wp-content/plugins/conn1_card/card-default.php on line 325Fatal error: require_once(): Failed opening required ‘./class.customizer.php’ (include_path=’.:/usr/lib/php7.0′) in /homepages/34/d560985172/htdocs/clickandbuilds/test/wp-content/plugins/conn1_card/card-default.php on line 325
(BTW, I temporary changed the permissions to 777 for all files inside the template folder. But this hasn’t changed anything)
Regards
Patrick08/11/2017 at 4:29 am #431986Patrick
ParticipantHi Steve,
I found that you need to use __ FILE __ instead of FILE. The __ was probably remove from your last Reply #431596.Now it looks like I can open the customizer, but it’s not displaying the entry with the “my1card” template, instead it shows the “names” template.
And any change I do in the customizer cannot be saved.
When I click the “save&publish” button, it doesn’t save (normally the button reverts to “saved”).Is there generally an issue with the template path?
When I check the system information I get:
- Connections Folder Permissions
Image Path Exists: Yes
Image Path Writeable: YesTemplate Path Exists: No
Template Path Writeable: NoCache Path Exists: Yes
Cache Path Writeable: YesRegards
Patrick - Move the
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.