Coder Social home page Coder Social logo

marghoobsuleman / hashtagcms Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 4.0 11.64 MB

HashtagCms, Use it as Headless CMS or Bundled, API enabled, Admin Panel, multisite, multi-tenant, multiplatform, multilingual with endless possibilities. The Most powerful, fast, user-friendly and secured platform. Made with PHP Laravel Framework.

Home Page: https://www.hashtagcms.org

License: MIT License

PHP 81.80% JavaScript 1.62% Vue 8.45% MAXScript 0.57% SCSS 0.56% Blade 7.00%
api-enabled cms headless headless-cms laravel open-source php

hashtagcms's People

Contributors

marghoobsuleman avatar sulemanmarghoob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hashtagcms's Issues

[Default route] Non-existant path crashes the Kernel: errorMessage--->"Could not find the category." (Error in calling controller)

Hello Marghoob,

Because HastagCMS uses its own routing, I see that there is no default route defined. It is very easy for any one to crash the Kernel and identify every sensitive detail of the installation.

You can verify this method of making a crash. Just enter any term in the URL of (what you call) category THAT DOES NOT EXISTS to make the Kernel crash. I entered /stories and got following crash error:

``

popluated "Error in calling controller (MarghoobSuleman\HashtagCms\Http\Controllers\FrontendController@index)"
errorMessage "Could not find the category."
``

It would be better to have a predefined route in the controller for routing that defaults to the main page like home, should a category or path does not exists.

[Feature request] Domain name based numbering system of IDs: site_ids, lang_ids, etc.

Hello Marghoob,

After having problems of different nature, I was compelled to install everything from fresh. Due to this, I have customized everything multiple times. The time invested in customizing it becomes useless, when starting from fresh. There is a ZERO chance to import the old data. SQL inserts does not help.

When one begins to customize, php scripts begins to create IDs in database. The next time, you may not follow the same sequence of customization. This results into different IDs. There does not exists any absolute system default of creating IDs. They are installed relative to the pattern followed by the administrator.

Concept:
I suggest to abolish the relative IDs from everywhere.

The HashtagCMS core Controllers (all) will create and inherit (absolute or script generated) IDs, wherever possible, based on specific logic. These IDs will not be based on SQL record_ids.

Implementation:
Table: sites
At the time one adds the site, the Controller uses the first four alphabets and the first two alphabets of a domain, convert it into a number to create the site_id. The field id in site table will be used only for SQL purpose.

For HashtagCMS.com, the Controller will calculate the following based on alphabets mapping to numbers, a--->01, b--->02, etc:

h = 08
a = 01
s = 19
h = 08
c = 03
o = 15

The Table: sites will have:

id | site_id | name | category_id | etc.

01 | 080119080315 | Hashtag CMS | 1 | 1 | 1 | 1 | 110 | 0 | HashtagCMS.com | etc.

If the site has less than four alphabets/numbers, it will add defaults.

Advantages:
All other tables will hold references from this site--->site_id 080119080315 everywhere. The advantage of this system will be:

Because the site--->site_id 080119080315 will be generated by the scripts based on specific logic related to the domain itself, like five alphabets/numbers, etc., it will always remain the same within the database.

It can be used later on because the same scripts will generate the same IDs.

Applying this logic, one could extend the concept to other areas, like currency, languages, etc.

These IDs will remain the same everywhere as well as between the backups and different databases.

The absolute referencing system opens doors to export and imports amongst database versions and backups.

One could update databases based on absolute_ids.

All the records within the database will have absolute reference and shall not be relative to particular installation any more.

Had this system be in there, then I could have imported SQL INSERT queries. This would help starting from fresh and thereafter executing custom queries based on absolute_ids.

Almost all CMS use relative IDs based on SQL record_ids. Due to this, other CMS have an inborn drawback mentioned in above four aspects.

page_langs: Error Call to a member function lang() on null

Hello,

After adding a page, I got following error:

Error Call to a member function lang() on null
https://domain.com/admin/page/store

MarghoobSuleman\HashtagCms\Http\Controllers\Admin\BaseAdminController::saveAllData
vendor/marghoobsuleman/hashtagcms/src/Core/Traits/Admin/AdminCrud.php:307

In the Debug Query, it showed (copied here, only relevant):
select
langs.*,
lang_site.site_id as pivot_site_id,
lang_site.lang_id as pivot_lang_id
from
langs
inner join lang_site on langs.id = lang_site.lang_id
where
lang_site.site_id in (1)

Connection name
mysql

ErrorException
Undefined array key "title" (View: /xxx/public_html/hashtagcms/vendor/marghoobsuleman/hashtagcms/resources/views/be/default/page/addedit.blade.php)

I have manually added (phpmyadmin) a record in the table page_langs manually.
It worked and does not crash any more. Thereafter, I have not added any further page.

getThemeInfo()--->HashtagCms\Models\Theme, null returned

Hello,

In the portal, I have done the following:

  • Added one site (Site2) site_id=5
  • Added one more language lang_id=5
  • Added one more theme theme_id=5
  • Configured the settings of the theme and categories
  • Added one Blog and one Page in both languages

Thereafter, I got following error in BE/FE:

TypeError
MarghoobSuleman\HashtagCms\Core\Main\InfoLoader::getThemeInfo(): Return value must be of type MarghoobSuleman\HashtagCms\Models\Theme, null returned
https://domain.com/login

MarghoobSuleman\HashtagCms\Core\Main\InfoLoader::getThemeInfo
vendor/marghoobsuleman/hashtagcms/src/Core/Main/InfoLoader.php:403

I observe the following:

In the table sites, I have two entries for Site1 & Site2 with the default language land_id=1 as well as theme_id=1 and theme_id=5. There is no data lang_id=5 related to Site2.

I created two entries by copy of both existing entries (as above) with identical data and changing the lang_id.

Now there are two entries for lang_id=5 for both the sites. The theme_id and site_id is also there.

The above error continues. Any further ideas what I could do?

[Feature request] Ability to add aliases for combined use of subdomains on multisites and for CDN

Hello,

I have configured two domains: DomainOne.com and DomainTwo.com. However, if I give in the URL www.DomainOne.com and www.DomainTwo.com, I get an error (env=prod):

"Site has not been set up"

The adding of aliass of sites like www. is important. Secondly, one could configure subdomains pertaining to a language and parked it on the main domain, as follows:

en.DomainOne.com--->/home/xxx/public_html/hashtagcms/public
de.DomainOne.com--->/home/xxx/public_html/hashtagcms/public

en.DomainTwo.com--->/home/xxx/public_html/hashtagcms/public
de.DomainTwo.com--->/home/xxx/public_html/hashtagcms/public

Based on the aliases, Laravel + HashtagCMS could fetch respective contents based on site_id and lang_id. currently this is not possible.

Language initialization in session: loadData: Lang is exist but not supported for this site

Hello,

After I managed to have multisite working on two domains, one domain in English and other in German, I am not able to load the data on GermainDomain.com, where only German language blog should be loaded.

Earlier this gave problems initially. After I added English language, things began to work in the same browser. Thus, I see that the lang_id was entered into the browser cache.

Purposely, I opened a different browser (latest firefox) to check this. Yes, the page showed 404 error from Laravel. I got following error:

[2022-01-09 20:21:08] prod.INFO: ================== FeMiddleware: [blog/blog-in-deutsch] ==================== [2022-01-09 20:21:08] prod.INFO: BaseInfo: Start Processing... [2022-01-09 20:21:08] prod.INFO: ==========- init common -=============== [2022-01-09 20:21:08] prod.INFO: From Cache (489704dff0e4133696c035ba919409cd): Fetching site info domain: domain.de, context: [2022-01-09 20:21:08] prod.INFO: ======================= setSiteInfo ================================ [2022-01-09 20:21:08] prod.INFO: setSiteInfo:siteInfo {"id":4,"name":"domain Hauptseite","context":"domaindeportal","favicon":"","category_id":10,"theme_id":4,"tenant_id":1,"lang_id":1,"country_id":1,"domain":"domain.de","lang_count":null,"under_maintenance":0} [2022-01-09 20:21:08] prod.INFO: ====================================================================== [2022-01-09 20:21:08] prod.INFO: From Cache (08424b839ae6233adbf573402ed54d29): Fetching tenant info: Path: blog, lang_id: 1 [2022-01-09 20:21:08] prod.INFO: ======================= setLanguageInfo ================================ [2022-01-09 20:21:08] prod.INFO: setLanguageInfo:langInfo {"id":1,"name":"English","iso_code":"en","language_code":"en","date_format_lite":"Y-m-d","date_format_full":"y-m-d H:i:s","is_rtl":0,"created_at":"2022-01-07T19:02:02.000000Z","updated_at":"2022-01-07T19:02:02.000000Z","deleted_at":null} [2022-01-09 20:21:08] prod.INFO: ==================================================================================== [2022-01-09 20:21:08] prod.INFO: From Cache (c118fdc665a875ececfb571278e0ffeb): Fetching tenant info: Path: blog, lang_id: 1 [2022-01-09 20:21:08] prod.INFO: ======================= setTenantInfo ================================ [2022-01-09 20:21:08] prod.INFO: setTenantInfo:langInfo {"id":1,"name":"Desktop","link_rewrite":"web","created_at":"2022-01-07T19:02:09.000000Z","updated_at":"2022-01-07T19:02:09.000000Z","deleted_at":null} [2022-01-09 20:21:08] prod.INFO: ==================================================================================== [2022-01-09 20:21:08] prod.INFO: path array ["blog","blog-in-deutsch"] [2022-01-09 20:21:08] prod.INFO: ============== Setting Controller Info ============== [2022-01-09 20:21:08] prod.INFO: From Cache (2b2d079f9a8a78f86a4919646360e2d2): Fetching category info [2022-01-09 20:21:08] prod.INFO: ======================= setCategoryInfo ================================ [2022-01-09 20:21:08] prod.INFO: setCategoryInfo:categoryInfo {"id":16,"parent_id":null,"site_id":4,"is_site_default":0,"is_root_category":0,"is_new":0,"has_wap":0,"wap_url":null,"link_rewrite":"blog","link_navigation":null,"link_rewrite_pattern":"{link_rewrite?}","controller_name":null,"has_some_special_module":0,"special_module_alias":null,"required_login":0,"insert_by":1,"update_by":1,"publish_status":1,"read_count":0,"created_at":"2022-01-07T19:16:56.000000Z","updated_at":"2022-01-09T18:23:20.000000Z","deleted_at":null} [2022-01-09 20:21:08] prod.INFO: ====================================================================== [2022-01-09 20:21:08] prod.INFO: ["blog","blog-in-deutsch"] [2022-01-09 20:21:08] prod.INFO: ----- Found category controller: Blog ------ [2022-01-09 20:21:08] prod.INFO: ======================= setControllerInfo ================================ [2022-01-09 20:21:08] prod.INFO: setControllerInfo: {"callable":"MarghoobSuleman\\HashtagCms\\Http\\Controllers\\BlogController","callableValue":["blog-in-deutsch"],"controllerName":"blog","categoryName":"blog","method":"index"} [2022-01-09 20:21:08] prod.INFO: ================== End============================================ [2022-01-09 20:21:08] prod.INFO: ============ Start loading data from request ============= [2022-01-09 20:21:08] prod.INFO: ============== layoutManager: Start. ============== [2022-01-09 20:21:08] prod.INFO: loadData: From Cache (en): Fetching site info, context: domaindeportal [2022-01-09 20:21:08] prod.INFO: loadData: From Cache (domaindeportal): Fetching site info, context: domaindeportal [2022-01-09 20:21:08] prod.INFO: loadData: Fetching again for lang info lang:en, with context: domaindeportal [2022-01-09 20:21:08] prod.INFO: {"lang_code":"en","site_id":4} [2022-01-09 20:21:08] prod.INFO: loadData: Lang is exist but not supported for this site [2022-01-09 20:21:08] prod.INFO: layoutManager: loading data completed, status: 404 [2022-01-09 20:21:08] prod.INFO: Error loading in page: status: 404 message: Lang is exist but not supported for this site

Please mark tags with alpha/beta/stable and provide install instructions, specific to php, Laravel, etc.

Hello,

Earlier, I somehow managed to install HashtagCMS on php 7.4.27. Initially it threw errors because a few columns in tables were missing, like site_id in categories (not in categories_sites), etc. After I manually created them, it began to work. Going through different areas in Admin, I was logged out as the plug-in in my browser logged me out. Thereafter, I had difficulties to login. I found that sessions in file works and not in the database.

I removed this installation and tried to install it once again. I could not. Then I tried to install on php 8.0. It installed with Laravel Framework 8.77. I could login in admin. Clicking on each menu, more than half of the links gave error. See my first parallel issue (open). Afterwards, I tried to install them on both php platform. I received disappointing results. What worked did not work.

I have realized that this is because composer had installed different packages during the installs, while I have followed install instruction published by you.

In a nutshell, I found that the Readme.md file you have published was very old and did not match with the recent Laravel Framework. Earlier, HashtagCMS versions used illuminate modules. Recent version does not and Laravel Framework is automatically installed.

I find the HashtagCMS is a powerful script but difficult to use because specific and clear install instructions are missing.

Thus, I suggest:

  1. Please mark tags of HashtagCMS with alpha, beta and stable for others to identify, which version to use it for install.

  2. Please give clear instructions on fundamental requirements in relation to php, Laravel, etc. For e.g. install instructions on:

  • php 7.4.27 plus HashtagCMS 1.3.0,

  • php 8.0+ plus HashtagCMS 1.3.0

  • which Laravel version should be installed with php versions above

Only these minor things are missing. In absence of above clear instructions, it becomes very difficult for others to use the HashtagCMS.

Admin menu links not working: Error ---> Call to undefined method App\Models\User::isSuperAdmin()

Hello,

I know from the earlier installation (1.0/1.1/1.2) that this HashtagCMS you designed is powerful.

Earlier, it had a couple of bugs and so I decided not to use it. It wanted me to create tenants.site_id, langs.site_id and countries.country_id. manually. I did. I had to stop it because it was on php 7.3 and older Laravel.

I just install fresh Laravel installation of Laravel 8.7. Thereafter, I followed the installation instruction by you and installed HashtagCMS.

After login into the dashboard of HashtagCMS, I find that only some menus could generate further webpages, i. e. the code could resolve. However, some other menu links gives following error:

Call to undefined method App\Models\User::isSuperAdmin()

I am looking forward to using your masterpiece but with the above error, I am stuck.

Any solution?

Just to observe: it would have been better, if you had done on release basis and install all dependencies including of Laravel in original. Because all the routes will have to go through the HashtagCMS (to resolve the domains) there is no harm to have Laravel installed with the fresh. But may be not doing so, you may have reasons.

Custom theme not working: prod.INFO--->Unable to find view: hashtagcms::fe.basic.header/subscribe/footer

Hello Marghoob,

I created a new theme in admin, copied "basic" theme directory to mybasic and saved the name of the directory in admin/theme. I changed the current theme name basic--->mybasic for both domains in both languages.

It was loading the basic theme directory. So, I renamed /vendor/marghoobsuleman/hashtagcms/resources/views/fe-->to-->fex.

It began to load the theme from the /resources/views/vendor/hashtagcms/fe/basic. I did not want this as I want to load from my custom theme directory "mybasic". Thus, I renamed this directory fe-->to-->fex also.

Now, HashtagCMS MUST load the theme from "mybasic". Unfortunately, the current installation didi not recognize a custom theme. In laravel.log, I found following relevant information coming from the FeHelper:

[2022-01-10 21:53:51] prod.INFO: layoutManager: loading data completed, status: 200
[2022-01-10 21:53:51] prod.INFO: layoutManager: setFinalObject
[2022-01-10 21:53:51] prod.INFO: layoutManager: setThemePath
[2022-01-10 21:53:51] prod.INFO: Unable to find view: hashtagcms::fe.basic.header
[2022-01-10 21:53:51] prod.INFO: Unable to find view: hashtagcms::fe.basic.subscribe
[2022-01-10 21:53:51] prod.INFO: Unable to find view: hashtagcms::fe.basic.footer
[2022-01-10 21:53:51] prod.INFO: layoutManager: after setThemePath
[2022-01-10 21:53:51] prod.INFO: layoutManager: setFinalObject again
[2022-01-10 21:53:51] prod.INFO: ============ layoutManager: End. ===========

I will have to work with the basic theme directory until you offer a patch.

[Feature request] Dashboard--->[#CMS]: php artisan commands to force update resources in backend and to clear caches

Hello Marghoob,

Problem:

Same php installation with its database works on one domain but does not work on a different domain. What worked did not work any more.

The problem of caching with Vue.js scripts could happen on every clients computer of an administrator. It applies to assets in backend.

Solution:

Add a function in Dashboard nav_topbar to manually update BE_RESOURCE_VERSION with a button. This will force load all assets on clients workstation. When adding this functionality, it could be helpful to have a couple of functions, for e.g.:

Dashboard--->[#CMS]: php artisan optimize:clear
Dashboard--->[#CMS]: php artisan cache:clear
Dashboard--->[#CMS]: php artisan view:clear

Earlier, I had problems regarding this issue here: https://github.com/marghoobsuleman/hashtagcms/issues/21. Your solution of env('BE_RESOURCE_VERSION', '011520221539')] was correct. I had different results because several situations combined gave different results.

[Feature request] Cloning new sites from a master site (template)

If one wants to create a new site, one has to create it manually. In this process, errors appeared due to manually cloning each elements. This issue is here: https://github.com/marghoobsuleman/hashtagcms/issues/20

From the experience of the above issue, it would be the best to provide cloning function with one click. Here are my suggestions:

  • Provide one master site template in the default installation. For e.g. in table sites_master_template.
  • All important values from the master site template cannot be deleted.
  • Provide in the master site template by default multiple languages and multiple categories to clone for new site creation, at least two of them.
  • The master site template can be extended to contain extra values like new categories, new languages, etc.
  • Provide a backup function of the database.

After providing some basic values in a form to create a new site, the master site template will feed default values in all tables in the database and create a new site.

Here are the advantages:

  • Cloning function will feed necessary values, including multiple languages and multiple categories etc, with one click.
  • The default values in the sites_master_template will not create a Kernel crash.
  • Creation of new site will have standard look or layout and menu amongst other sites.
  • One can expand languages, categories, etc. into multiple sites with one click.
  • Because the scripts are stable and will not create a Kernel crash, the database can be reverted to its old version from a backup, should something go wrong.

Had I had created three languages and ten categories based on master site template, then I could have cloned it - for e.g. - ten new sites with one click instead of going through each area of every new site manually.

With the feature of backup, one could revert the entire database (after newly created site) to it original state manually.

I think this feature request will become a powerful function in the HashtagCMS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.