CompanyDirectory - pretty URLs

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
smithdesign77
Forum Members
Forum Members
Posts: 25
Joined: Mon Jan 02, 2017 10:27 pm

CompanyDirectory - pretty URLs

Post by smithdesign77 »

Hello all...
I am currently updating a quite old site to the newest core version. Therefore the old CompanyDirectory module of course also needs to get upgraded.
I was unable to import the data from the old version into the new (the data was imported into the database, however was never displayed in the module admin page even after several attempts, preparing custom fields, etc. — even though it was readable at the front end ??? ) ... however, I decided to relaunch the site completely from scratch (the customer is, luckily, fine with that too and actually the count of items is not that much (just like twenty)).
So, it's all vanilla, completely the latest release and using PHP7.2.

I figured already that this new version of CompanyDirectory must be a sort of major rewrite, alone by the version numbers (going straight from 1.23.12 to 1.900 - I am using the 1.907). Also by the lengths and contents of the module help page I can figure that the possible functionality must be huge, although I already would've been totally happy with what I had back then with 1.22.7. ;D

So, after a few bumps from scratch (if you are interested, I'll attach that under my question) I am currently running into a (probably very minor) problem, but can't think of a way to fix it:

When I click the link to the details page of one entry, it works like a charm without url_rewriting enabled. The link is just ugly like www.example.com/index.php?mact=CompanyD ... returnid=4
With the old module I had a link like www.example.com/entry-name.html

The new version does create a link exactly like the old version did - but it returns a #404. :-\

I do have the detail page set up, with a detail page template of CompanyDirectory as content, and I do have the hint in the logic field of the referring page like this here:

Code: Select all

{cms_module_hint module=CompanyDirectory categoryid='5' detailpage=detailansicht summarytemplate='cms_template:cd__summary_listing'}
I have also tried to get the snippet of detailpage=detailansicht into the original tag like {CompanyDirectory detailpage=detailansicht} and I tried to integrate it into the link created inside the summary template like: {cms_action_url action=details compid=xxxx detailpage=detailansicht}.

Now I can't think of further ways how to pass the info and I do think, that the module would present the proper details template if it knew how to actually do that. If I call the URL of the details template page (which is not a public URL but only used by the module) I do get all the information including all the custom fields, but of course — of all the entries... ::)

Can you explain briefly to me, where I shall set the link/name/id/alias of the details page, so the system can puzzle together the $id+details page/template?
Thank you very much!

===

As promised before:

Most probably all the possibilities are what's cracking my head and why I can't find the particular information I need - for example about the usage of templates:
Earlier they were simply integrated inside the CompanyDirectory module and with the included examples really a total no-brainer. Now all I was able to find regarding 'templates' were the files in the module file folder — and eventually I was able to get some into the design manager and get them running ... what took me a while though.

Before that I had another try by copying template files into the assets/module_custom/CompanyDirectory folder as described in the module help and also the official documentation here, but that did not work out for me. ??? The templates were simply never used (frontend templates only though).

I guess that the process of working with the design manager and/or template files int the assets/module_custom folder referring to cms_template:xxx or whatever else is a very CMSms-basic-thinking. However, I'd like to propose to document this in the help page of future versions for those not so familiar with CMSms? Perhaps a link to the cmsmadesimple.org regarding such basics was suitable too?

I think working with CMSms is very quick and easy - but this new way with module-specific templates without examples and without further help is actually complicated and lenghty, I'd say.

===

What gives me the next headache is that I can't manage to get the lat:lng information saved. If I enter the digits like I receive them from google maps (like 52.516283, 13.377909), the field turns red and requires a "number". If I'd use a comma, it returns "Invalid lat/long passed to CompanyDirectory\Company::__construct". If I use the arrows of the field I get the same error. I can't tell if that is a bug ... but right now it is not functioning for me. :'(
I guess I'll look once more into that custom admin template if I can alter the field there, but apparently this field and it's function was untested.

===

Finally my last proposal is about the picture upload. The earlier version did not require to upload the file into the file system to then copy an instance into the idX-folder. The file was selected from my hard drive and uploaded directly without step in between. Now this may be a thing of the file manager; couldn't tell. However, working with new entries is upload-to-temporary->select-file->copy-to-final-location, which takes longer and stacks unnecessary duplicate files. No biggie though - only not-typical for CMSms, as far as I could say.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CompanyDirectory - pretty URLs

Post by calguy1000 »

CD 1.9xx and further uses config entries (entries in the config.php) for various settings, it does not use module hints.

So. If you have defined URL slugs for your articles and your URLs are in the form of <site.com>/<your-url-slug> then it will use the $config['cd_detailpage'] config entry as defined in the module help.

I would suggest you edit that config entry with the page id or alias of the detailpage you want to use and also, just in case go to system maintenance and rebuild static URL's.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
smithdesign77
Forum Members
Forum Members
Posts: 25
Joined: Mon Jan 02, 2017 10:27 pm

Re: CompanyDirectory - pretty URLs

Post by smithdesign77 »

Hello Robert,

thank you for taking your time and explaining this to me! :)
Worked like a charm, exactly as you said after:
• editing the config.php in the root directory and
• updating the routes in maintenance

Problem solved! ;D
I'll mark the topic then as such.

===

Just as a note...
I really try my utmost to figure a possible fix by myself using the help and google, stackoverflow, etc., while I am (with every problem I run into) confident, that I certainly cannot be the first guy encountering it. Therefore I try to post as less I can and — if inevitable — describe my problem in the best and clearest way I can possibly think of — also for the next guy searching about the same matter.

After reading your reply I couldn't find a (clear in my eyes) sentence about the possibility of settings in the config.php.
Actually, searching the help page for the term "config.php" gives me exactly one match, which is about frontend editing settings like cd_frontend_create and cd_frontend_maxrecords.

Like I said in my first post, it may make sense - in order to present the needed answers at the right level of knowledge for the individual user - to part up the various help you provide in smaller bits, like also links to the online documentation, etc.
Perhaps not only for this specific module but as a general direction.

I gratefully use CMSms since 1.1 and quickly found a way back then to wrap my head around the logic you developer guys put in here. I am a designer, not a coder, what may give me some extra struggle (if anyone starts talking about classes, objects, arrays and what-all, my head blows up). Of course things change over a decade or two and step by step I tried to keep up - module settings within the config.php is a brand new thing for me.

So, overall you are totally right, that the information was right there in the help page and this whole post therefore wouldn't have to exist and you could've spent your valuable time with more important things as answering stupid noob questions ... but exactly for such noobs as I am there would've been a little sentence or hyperlink great in the help right at the header of "Config entries" to explain how the settings are been set actually.
I did see this section, but actually I thought my installation may be corrupted, while the settings earlier had been within the module. ???
I also must admit that English is not my first language, so reading a lot very detailled technical stuff exhausts me.

Last but not least I want to thank you once more, for your efforts of developing and also supporting. I cannot imagine how time consuming this must be. Alone the help page must've been a ton and does have lots of information, just not as clear described as I had needed it. My proposal of "clearing it up some more" in the help page is intended only positive, to spare you time in the future and I hope that I didn't say something wrong.
I could try to contribute ... however I neither understand too much of all the possibilities there and again English is not my first language.

Have a good day! :)
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: CompanyDirectory - pretty URLs

Post by paulbaker »

smithdesign77 wrote:I could try to contribute ... however I neither understand too much of all the possibilities there and again English is not my first language.
Please consider applying to join the Dev Team. Many Dev Team members don't have English as their main language and you don't need to be a code geek to contribute something positive to the project. Bring your strengths to the team.
https://www.cmsmadesimple.org/about/team/
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
Post Reply

Return to “Modules/Add-Ons”