{"id":15287361,"url":"https://github.com/975l/pageeditbundle","last_synced_at":"2025-08-12T14:46:20.768Z","repository":{"id":62498842,"uuid":"91893139","full_name":"975L/PageEditBundle","owner":"975L","description":"Create, modify and manage web pages","archived":false,"fork":false,"pushed_at":"2025-03-09T15:49:11.000Z","size":360,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T05:09:01.514Z","etag":null,"topics":["symfony","symfony-bundle","symfony-cms","tinymce","twig-pages"],"latest_commit_sha":null,"homepage":"https://975l.com/en/pages/pageedit-bundle","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/975L.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":"LaurentMarquet","open_collective":"laurent-marquet","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://buymeacoff.ee/laurentmarquet"}},"created_at":"2017-05-20T14:05:20.000Z","updated_at":"2025-03-09T15:49:13.000Z","dependencies_parsed_at":"2025-04-13T05:09:09.670Z","dependency_job_id":"362c1139-82fe-4a8c-8091-807f355166a6","html_url":"https://github.com/975L/PageEditBundle","commit_stats":null,"previous_names":[],"tags_count":121,"template":false,"template_full_name":null,"purl":"pkg:github/975L/PageEditBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/975L%2FPageEditBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/975L%2FPageEditBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/975L%2FPageEditBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/975L%2FPageEditBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/975L","download_url":"https://codeload.github.com/975L/PageEditBundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/975L%2FPageEditBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268272977,"owners_count":24223790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["symfony","symfony-bundle","symfony-cms","tinymce","twig-pages"],"created_at":"2024-09-30T15:27:56.158Z","updated_at":"2025-08-01T18:10:43.518Z","avatar_url":"https://github.com/975L.png","language":"PHP","funding_links":["https://patreon.com/LaurentMarquet","https://opencollective.com/laurent-marquet","https://buymeacoff.ee/laurentmarquet"],"categories":[],"sub_categories":[],"readme":"# PageEditBundle\n\nPageEditBundle does the following:\n\n- Displays pages requested,\n- Provides tools to edit content of pages, unless of doing it via a code editor,\n- Integrates with your web design,\n- Protects twig code from being formatted,\n- Archives the files before replacing them in order to be able to retrieve old versions,\n- Gives the possibility to create a `sitemap.xml̀` of managed files, setting their change frequency and priority,\n- Allows to store specific templates in a `protected` folder to display it but not being able to modify it,\n- Allows to create a PDF version of pages,\n\nIt is, of course, still possible to modify directly those files with an editor.\n\nThis Bundle relies on the use of [TinyMce](https://www.tinymce.com/), [jQuery](https://jquery.com/) and [Bootstrap](http://getbootstrap.com/).\n\n[PageEditBundle dedicated web page](https://975l.com/en/pages/pageedit-bundle).\n\n[PageEditBundle API documentation](https://975l.com/apidoc/c975L/PageEditBundle.html).\n\n## Bundle installation\n\n### Step 1: Download the Bundle\n\nUse [Composer](https://getcomposer.org) to install the library\n\n```bash\n    composer require c975l/pageedit-bundle\n```\n\n### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding them to the list of registered bundles in the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = [\n            new c975L\\PageEditBundle\\c975LPageEditBundle(),\n        ];\n    }\n}\n```\n\n### Step 3: Configure the Bundle\n\nCheck dependencies for their configuration:\n\n- [KnpPaginatorBundle](https://github.com/KnpLabs/KnpPaginatorBundle)\n- [KnpSnappyBundle](https://github.com/KnpLabs/KnpSnappyBundle)\n- [wkhtmltopdf-amd64](https://github.com/h4cc/wkhtmltopdf-amd64)\n\nFor KnpSnappyBundle you can use this configuration if it suits to your needs.\n\n```yml\nknp_snappy:\n    process_timeout: 20\n    temporary_folder: \"%kernel.cache_dir%/snappy\"\n    pdf:\n        enabled: true\n        binary: \"%kernel.project_dir%/../vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64\"\n        options:\n            print-media-type: true\n            page-size: A4\n            orientation: 'portrait'\n            encoding : utf-8\n            dpi: 300\n            images: true\n            image-quality: 80\n            margin-left: 10mm\n            margin-right: 10mm\n            margin-top: 10mm\n            margin-bottom: 10mm\n    image:\n        enabled: false\n```\n\nv2.0+ of c975LPageEditBundle uses [c975L/ConfigBundle](https://github.com/975L/ConfigBundle) to manage configuration parameters. Use the Route \"/pages/config\" with the proper user role to modify them.\n\nUpgrading from v1.x? **Check UPGRADE.md**\n\nIf you use Git for version control, **you need to add the full path `templates/[folderPages]` and `public/images/[folderPages]` in the `.gitignore`, otherwise all the content will be altered by Git.**\n\n### Step 4: Enable the Routes\n\nThen, enable the routes by adding them to the `app/config/routing.yml` file of your project:\n\n```yml\nc975_l_page_edit:\n    resource: \"@c975LPageEditBundle/Controller/\"\n    type: annotation\n    prefix: /\n    #Multilingual website use the following\n    #prefix: /{_locale}\n    #defaults:   { _locale: '%locale%' }\n    #requirements:\n    #    _locale: en|fr|es\n```\n\n### Step 5: Link and initialization of TinyMce\n\nIt is strongly recommended to use the [Override Templates from Third-Party Bundles feature](http://symfony.com/doc/current/templating/overriding.html) to integrate fully with your site.\n\nFor this, simply, create the following structure `templates/bundles/c975LPageEditBundle/views/` in your app and then duplicate the file `layout.html.twig` in it, to override the existing Bundle files, then apply your needed changes, such as language, etc.\n\nIn `layout.html.twig`, it will mainly consist to extend your layout and define specific variables, i.e. :\n\n```twig\n{% extends 'layout.html.twig' %}\n\n{# Defines specific variables #}\n{% set title = 'PageEdit (' ~ title ~ ')' %}\n\n{% block content %}\n    {% block pageedit_content %}\n    {% endblock %}\n{% endblock %}\n```\n\nIt is recommended to use [Tinymce Cloud version](https://go.tinymce.com/cloud/). You will need a [free API key](https://store.ephox.com/my-account/api-key-manager/).\n**OR** you can download and link to your project [https://www.tinymce.com/download/](https://www.tinymce.com/download/).\n\nIf you want to keep all the available tools and make no change to Tinymce as it is, you don't need to overwrite `tinymceInit.html.twig`. You just need to provide, in `parameters.yml`, your `tinymceApiKey` (see above) if you use the cloud version and the `tinymceLanguage` (+ upload the corresponding file on your server under `public/vendor/tinymce/[tinymceLanguage].js`). Oherwise you need to override `tinymceInit.html.twig`.\n\n### Step 6: Definitions of start and end of template for file saving\n\nWhen the Twig file is saved, it is concatenated with the content of `Resources/views/skeleton.html.twig` to obtain the full file.\n\nThis file must extends your layout in order to display correctly. It is recommended to **NOT** override this file, but if you do so, take care to keep `{% block pageedit_content %}` and `{% endblock %}` as they are the entry and exit points to defines content.\n\n### How to use\n\nThe Url to display a page is `http://example.com/pages/{page}`, the one to edit is `http://example.com/pages/modify/{page}`, to display a PDF is `http://example.com/pages/pdf/{page}`.\n\nA toolbar is displayed below the title if user is identified and has the acess rights.\n\nLink to a page, in Twig, can be done by `\u003ca href=\"{{ path('pageedit_display', { 'page': 'slug' }) }}\"\u003eTitle of the page\u003c/a\u003e`.\n\nThe different Routes (naming self-explanatory) available are:\n\n- pageedit_home\n- pageedit_config\n- pageedit_display\n- pageedit_pdf\n- pageedit_create\n- pageedit_modify\n- pageedit_duplicate\n- pageedit_delete\n- pageedit_dashboard\n- pageedit_upload\n- pageedit_slug\n- pageedit_links\n- pageedit_help\n\n### Creation of PDF\n\nPageEditBundle uses `KnpSnappyBundle` to generates PDF, which itself uses `wkhtmltopdf`. `wkhtmltopdf` requires that included files, like stylesheets, are included with an absolute url. But, there is a known problem with SSL, see [#3001](https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3001), which force you to downgrade openssl, like in [Gist](https://gist.github.com/kai101/99d57462f2459245d28b4f5ea51aa7d0).\n\nYou can avoid this problem by including the whole content of included files, which is what `wkhtmltopdf` does, in your html output. To integrate them easily, you can, as [c975L/SiteBundle](https://github.com/975L/SiteBundle) does, use [c975L/IncludeLibraryBundle](https://github.com/975L/IncludeLibraryBundle) with the following code:\n\n```twig\n{# in your layout.html.twig \u003e head #}\n    {% if display == 'pdf' %}\n        {{ inc_content('bootstrap', 'css', '3.*') }}\n        {{ inc_content(absolute_url(asset('css/styles.min.css')), 'local') }}\n    {% else %}\n        {{ inc_lib('bootstrap', 'css', '3.*') }}\n        {{ inc_lib('cookieconsent', 'css', '3.*') }}\n        {{ inc_lib('fontawesome', 'css', '5.*') }}\n        {{ inc_lib(absolute_url(asset('css/styles.min.css')), 'local') }}\n    {% endif %}\n```\n\n### Integrate sub-pages\n\nTo add sub-pages in sub-folders, simply use a \"/\" as separator in the Url semantic field.\n\n### Homepage specific\n\nThe home page can be managed via PageEdit, but as it is called at the root of the website it has a specificity. it's name is \"home\" and cannot be changed.\n\n### Protect specific templates\n\nIf you need to protect specific templates (containing lot of Twig tag, Twig variable setting, etc. or if you don't want your final user to be able to modify them, to not break the website), simply put those templates in `templates/[folderPages]/protected`, they will be displayed as other, and included in the sitemap, but not available for modifications.\n**You just need to encapsulate the content of the template within the `skeleton.html.twig`.**\n\n### Use the Twig Extension to automate building menus\n\nYou can use the provided Twig Extension `folder_content()` to easily build menus based on the content of a specific folder, for this use the following code:\n\n```html\n{% set files = folder_content('specific_folder') %}\n\u003cul class=\"nav navbar-nav\"\u003e\n    \u003cli class=\"dropdown\"\u003e\n        \u003ca href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\"\u003eTitle \u003cspan class=\"caret\"\u003e\u003c/span\u003e\u003c/a\u003e\n        \u003cul class=\"dropdown-menu\"\u003e\n            {% for file, title in files %}\n                \u003cli\u003e\u003ca href=\"{{ path('pageedit_display', { 'page': file }) }}\"\u003e{{ title }}\u003c/a\u003e\u003c/li\u003e\n            {% endfor %}\n        \u003c/ul\u003e\n    \u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Migrating existing files to PageEdit\n\nTo migrate existing files, simply move your existing templates in the folder defined in `templates/[folderPages]` (`folderPages` has been defined in Step 3 above), access to PageEdit dashboard and do the modifications. The skeleton will be added to new files and old ones will be archived.\n\nYou can use the command `git rm -r --cached templates/[folderPages]` to remove it from Git, if the folder was previously indexed. **Don't forget to make a copy of it, if you use Git as versionning system and if you have added this folder in the `.gitignore`, otherwise your files will be deleted at next commit !**\n\nIf files have been deleted by Git, simply use the code below:\n\n```bash\ngit log #Gives you latest commit\ngit checkout \u003cid_commit\u003e #Indicate here the id of the commit obtained above\n#Access to your files, copy/paste them somewhere else\ngit checkout HEAD #Get back to latest version\n```\n\n### Create Sitemap\n\nIn a console use `php bin/console pageedit:createSitemap` to create a `sitemap-[folderPages].xml` in the `web` folder of your project. You can use a crontab to generate it every day.\nYou can add this file in a `sitemap-index.xml`that groups all your sitemaps or directly use it if you have only one.\n\nIf this project **help you to reduce time to develop**, you can sponsor me via the \"Sponsor\" button at the top :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F975l%2Fpageeditbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F975l%2Fpageeditbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F975l%2Fpageeditbundle/lists"}